XGrabButton(3X) — X Version 11
NAME
XGrabButton, XUngrabButton − manipulate the pointer
SYNTAX
XGrabButton(display, button_grab, modifiers, grab_window, owner_events, event_mask,
pointer_mode, keyboard_mode, confine_to, cursor)
Display ∗display;
unsigned int button_grab;
unsigned int modifiers;
Window grab_window;
Bool owner_events;
unsigned int event_mask;
int pointer_mode, keyboard_mode;
Window confine_to;
Cursor cursor;
XUngrabButton(display, button_ungrab, modifiers, ungrab_window)
Display ∗display;
unsigned int button_ungrab;
unsigned int modifiers;
Window ungrab_window;
ARGUMENTS
button_grabSpecifies the pointer button that is to be grabbed when the specified modifier keys are down.
button_ungrab
Specifies the pointer button that is to be released in combination with the modifier keys.
confine_toSpecifies the window to confine the pointer in or None if it is not to be confined.
cursorSpecifies the cursor that is to be displayed during the grab.
displaySpecifies the connection to the X server.
event_maskSpecifies which pointer events are reported to the client. They can be the bitwise inclusive OR of these pointer event mask bits: ButtonPressMask, ButtonReleaseMask, EnterWindowMask, LeaveWindowMask, PointerMotionMask, PointerMotionHintMask, Button1MotionMask, Button2MotionMask, Button3MotionMask, Button4MotionMask, Button5MotionMask, ButtonMotionMask, KeyMapStateMask.
grab_windowSpecifies the window ID of the window you want to grab.
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 if the pointer events are to be reported normally (pass True) or with respect to the grab window if selected by the event mask (pass 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 you want to ungrab.
DESCRIPTION
The XGrabButton function establishes a passive grab. .PN XGrabButton can generate BadAlloc, BadCursor, BadValue, and BadWindow errors.
The XUngrabButton function releases the passive button/key combination on the specified window if it was grabbed by this client. .PN XUngrabButton can generate a BadWindow error.
DIAGNOSTICS
BadAccess A client attempted to grab a key/button combination already grabbed by another client.
BadCursor A value for a Cursor argument does not name a defined Cursor.
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
XAllowEvents(3X), XGrabPointer(3X), XGrabKey(3X), XGrabKeyboard(3X),
Xlib − C Language X Interface
1 March 1988