in reply to Grabbing keyboard in X11

This thread: Forwarding key events while using XGrabKeyboard suggests that the XGrabKeyboard approach can't be made to work. However, it also refers to the XEvIE - X Event Interception Extension and the User Interface neXt project at sourceforge.net which may help you.

Also, check out the xspy key-logger and this bugtraq security note about it: Reminder: XGrabKeyboard is not a security interface.

Replies are listed 'Best First'.
Re^2: Grabbing keyboard in X11
by Hue-Bond (Priest) on Jun 23, 2008 at 12:21 UTC

    Thanks for your reply. Unfortunately, a Perl module around XEvIE doesn't seem to exist yet, so I'm stuck with X11::Protocol. On the other hand, I've taken a look into the source code of icewm and I've seen that it uses XGrabKey to grab the key combinations it uses. Something like:

    $x->GrabKey (52, 'AnyModifier', $x->root, 0, 'Asynchronous', 'Asynchronous');

    (52 being the keycode for the letter 'z').

    The only obstacle I have to overcome is how to translate 'z' to 52 (in this example) but I think X11::Keyboard's KeysymToKeycode will fit this purpose nicely.

    --
    David Serrano