XGrabPointer(3X) — X Version 11
NAME
XGrabPointer, XUngrabPointer, XChangeActivePointerGrab − manipulate the pointer
SYNTAX
int XGrabPointer(display, grab_window, owner_events, event_mask, pointer_mode,
keyboard_mode, confine_to, cursor, time)
Display ∗display;
Window grab_window;
Bool owner_events;
unsigned int event_mask;
int pointer_mode, keyboard_mode;
Window confine_to;
Cursor cursor;
Time time;
XUngrabPointer(display, time)
Display ∗display;
Time time;
XChangeActivePointerGrab(display, event_mask, cursor, time)
Display ∗display;
unsigned int event_mask;
Cursor cursor;
Time time;
ARGUMENTS
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 relative to which events are reported while it is grabbed.
keyboard_mode
Controls further processing of keyboard events. You can pass one of these constants: GrabModeSync or GrabModeAsync.
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.
timeSpecifies the time. You can pass either a timestamp, expressed in milliseconds, or CurrentTime.
DESCRIPTION
The XGrabPointer function actively grabs control of the pointer and returns GrabSuccess if the grab was successful. .PN XGrabPointer can generate BadCursor, BadValue, and BadWindow errors.
The XUngrabPointer function releases the pointer and any queued events, if this client has actively grabbed the pointer from XGrabPointer, XGrabButton, or from a normal button press.
The XChangeActivePointerGrab function changes the specified dynamic parameters if the pointer is actively grabbed by the client and if the specified time is no earlier than the last-pointer-grab time and no later than the current X server time. .PN XChangeActivePointerGrab can generate a BadCursor error.
DIAGNOSTICS
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), XGrabButton(3X), XGrabKey(3X), XGrabKeyboard(3X)
Xlib − C Language X Interface
1 March 1988