1XGrabButton(3X11) XLIB FUNCTIONS XGrabButton(3X11)
2
3
4
6 XGrabButton, XUngrabButton - grab pointer buttons
7
9 int XGrabButton(Display *display, unsigned int button, unsigned int
10 modifiers, Window grab_window, Bool owner_events, unsigned int
11 event_mask, int pointer_mode, keyboard_mode, Window confine_to,
12 Cursor cursor);
13
14 int XUngrabButton(Display *display, unsigned int button, unsigned int
15 modifiers, Window grab_window);
16
18 button Specifies the pointer button that is to be grabbed or
19 released or AnyButton.
20
21 confine_to
22 Specifies the window to confine the pointer in or None.
23
24 cursor Specifies the cursor that is to be displayed or None.
25
26 display Specifies the connection to the X server.
27
28 event_mask
29 Specifies which pointer events are reported to the client.
30 The mask is the bitwise inclusive OR of the valid pointer
31 event mask bits.
32
33 grab_window
34 Specifies the grab window.
35
36 keyboard_mode
37 Specifies further processing of keyboard events. You can
38 pass GrabModeSync or GrabModeAsync.
39
40 modifiers Specifies the set of keymasks or AnyModifier. The mask is
41 the bitwise inclusive OR of the valid keymask bits.
42
43 owner_events
44 Specifies a Boolean value that indicates whether the pointer
45 events are to be reported as usual or reported with respect
46 to the grab window if selected by the event mask.
47
48 pointer_mode
49 Specifies further processing of pointer events. You can pass
50 GrabModeSync or GrabModeAsync.
51
53 The XGrabButton function establishes a passive grab. In the future,
54 the pointer is actively grabbed (as for XGrabPointer), the last-
55 pointer-grab time is set to the time at which the button was pressed
56 (as transmitted in the ButtonPress event), and the ButtonPress event is
57 reported if all of the following conditions are true:
58
59 · The pointer is not grabbed, and the specified button is logically
60 pressed when the specified modifier keys are logically down, and
61 no other buttons or modifier keys are logically down.
62
63 · The grab_window contains the pointer.
64
65 · The confine_to window (if any) is viewable.
66
67 · A passive grab on the same button/key combination does not exist
68 on any ancestor of grab_window.
69
70 The interpretation of the remaining arguments is as for XGrabPointer.
71 The active grab is terminated automatically when the logical state of
72 the pointer has all buttons released (independent of the state of the
73 logical modifier keys).
74
75 Note that the logical state of a device (as seen by client applica‐
76 tions) may lag the physical state if device event processing is frozen.
77
78 This request overrides all previous grabs by the same client on the
79 same button/key combinations on the same window. A modifiers of Any‐
80 Modifier is equivalent to issuing the grab request for all possible
81 modifier combinations (including the combination of no modifiers). It
82 is not required that all modifiers specified have currently assigned
83 KeyCodes. A button of AnyButton is equivalent to issuing the request
84 for all possible buttons. Otherwise, it is not required that the spec‐
85 ified button currently be assigned to a physical button.
86
87 If some other client has already issued a XGrabButton with the same
88 button/key combination on the same window, a BadAccess error results.
89 When using AnyModifier or AnyButton, the request fails completely, and
90 a BadAccess error results (no grabs are established) if there is a con‐
91 flicting grab for any combination. XGrabButton has no effect on an
92 active grab.
93
94 XGrabButton can generate BadCursor, BadValue, and BadWindow errors.
95
96 The XUngrabButton function releases the passive button/key combination
97 on the specified window if it was grabbed by this client. A modifiers
98 of AnyModifier is equivalent to issuing the ungrab request for all pos‐
99 sible modifier combinations, including the combination of no modifiers.
100 A button of AnyButton is equivalent to issuing the request for all pos‐
101 sible buttons. XUngrabButton has no effect on an active grab.
102
103 XUngrabButton can generate BadValue and BadWindow errors.
104
106 BadCursor A value for a Cursor argument does not name a defined Cursor.
107
108 BadValue Some numeric value falls outside the range of values accepted
109 by the request. Unless a specific range is specified for an
110 argument, the full range defined by the argument's type is
111 accepted. Any argument defined as a set of alternatives can
112 generate this error.
113
114 BadWindow A value for a Window argument does not name a defined Window.
115
117 XAllowEvents(3X11), XGrabPointer(3X11), XGrabKey(3X11), XGrabKey‐
118 board(3X11),
119 Xlib - C Language X Interface
120
121
122
123X Version 11 libX11 1.0.3 XGrabButton(3X11)