12.2 Keyboard Grabbing

Xlib provides functions that you can use to grab or ungrab the keyboard as well as allow events.

For many functions in this section, you pass keymask bits. The valid keymask bits are: ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask.

To grab the keyboard, use XGrabKeyboard().

To ungrab the keyboard, use XUngrabKeyboard().

To passively grab a single key of the keyboard, use XGrabKey().

To ungrab a key, use XUngrabKey().

Next: Resuming Event Processing

Christophe Tronche, [email protected]