Is it possible (or how) to create a mechanism (in Linux X11, C++) that works like a global hook in windows (SetWindowsHookEx())?
I would like to be able to catch the key
Instead of doing this on the X11 level I recommend to do it on the input device level. /dev/input/event
give you the input events. You can read off the keypresses there and decide if they should propagate further or be consumed. Unfortunately there's no real documentation for this, but the header file linux/include/input.h
is quite self explanatory. Also the evdev maintainer will gladly answer emails.