XGrabKey(3X) — X Version 11
NAME
XGrabKey, XUngrabKey − manipulate the keyboard
SYNTAX
XGrabKey(display, keycode, modifiers, grab_window, owner_events, pointer_mode,
keyboard_mode)
Display ∗display;
int keycode;
unsigned int modifiers;
Window grab_window;
Bool owner_events;
int pointer_mode, keyboard_mode;
XUngrabKey(display, keycode, modifiers, ungrab_window)
Display ∗display;
int keycode;
unsigned int modifiers;
Window ungrab_window;
ARGUMENTS
displaySpecifies the connection to the X server.
grab_windowSpecifies the window ID of the window associated with the keys you want to grab.
keycodeSpecifies the keycode.
keyboard_mode
Controls further processing of keyboard events. You can pass one of these constants: GrabModeSync or GrabModeAsync.
modifiersSpecifies the set of keymasks. This mask is the bitwise inclusive OR of these keymask bits: ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask.
owner_events
Specifies a boolean value of either True or False.
pointer_mode
Controls further processing of pointer events. You can pass one of these constants: GrabModeSync or GrabModeAsync.
ungrab_window
Specifies the window ID of the window associated with the keys you want to ungrab.
DESCRIPTION
The XGrabKey function establishes a passive grab on the keyboard. .PN XGrabKey can generate BadAccess, BadValue, and BadWindow errors.
The XUngrabKey function releases the key combination on the specified window if it was grabbed by this client. .PN XUngrabKey can generate a BadWindow error.
DIAGNOSTICS
BadAccess A client attempted to grab a key/button combination already grabbed by another client.
BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument’s type is accepted. Any argument defined as a set of alternatives can generate this error.
BadWindow A value for a Window argument does not name a defined Window.
SEE ALSO
XAllowAccess(3X), XGrabButton(3X), XGrabKeyboard(3X), XGrabPointer(3X)
Xlib − C Language X Interface
1 March 1988