1 XIGRABBUTTON(libmansuffix)
2 ==========================
7 XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode -
8 grab/ungrab buttons or keys
13 #include <X11/extensions/XInput2.h>
15 int XIGrabButton( Display *display,
21 int paired_device_mode,
25 XIGrabModifiers *modifiers_inout);
27 int XIUngrabButton( Display *display,
32 XIGrabModifiers *modifiers);
34 int XIGrabKeycode( Display *display,
39 int paired_device_mode,
43 XIGrabModifiers *modifiers_inout);
45 int XIUngrabKeycode( Display *display,
50 XIGrabModifiers *modifiers);
52 int XIGrabTouchBegin( Display *display,
58 XIGrabModifiers *modifiers_inout);
60 int XIUngrabTouchBegin( Display *display,
64 XIGrabModifiers *modifiers);
67 Specifies the connection to the X server.
70 Specifies the device that is to be grabbed or released
73 Specifies the device button that is to be grabbed or
74 released or XIAnyButton.
77 Specifies the keycode that is to be grabbed or released
81 Number of elements in modifiers or modifiers_inout.
84 Specifies the set of latched and base modifiers or
85 XIAnyModifier to ungrab. The data type is for
86 consistency with the respective grab request and the
87 status code of the XIGrabModifiers struct is ignored.
90 Specifies the set of latched and base modifiers or
91 XIAnyModifier to grab. Returns the modifiers that could
92 not be grabbed and their error code.
95 Specifies the grab window.
98 Specifies a Boolean value that indicates whether the are
99 to be reported as usual or reported with respect to the
103 Specifies the event mask.
106 Specifies further processing of events from this device.
107 You can pass XIGrabModeSync or XIGrabModeAsync.
110 Specifies further processing of events from the paired
111 master device. You can pass XIGrabModeSync or
112 XIGrabModeAsync. If deviceid specifies a floating slave
113 device, this parameter is ignored.
118 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin establish a passive
119 grab. The modifier device for a button grab is the paired master device
120 if deviceid specifies a master pointer. Otherwise, the modifier
121 device is the device specified with deviceid. In the future,
122 the device is actively grabbed (as for XIGrabDevice, the
123 last-grab time is set to the time at which the button or keycode
124 was pressed and the XI_ButtonPress or XI_KeyPress event is
125 reported if all of the following conditions are true:
126 * The device is not grabbed, and the specified button or
127 keycode is logically pressed or a touch event occurs when the
128 specified modifier keys are logically down on the modifier device
129 and no other buttons or modifier keys are logically down.
130 * Either the grab window is an ancestor of (or is) the focus
131 window, OR the grab window is a descendent of the focus
132 window and contains the device.
133 * A passive grab on the same button/modifier combination does
134 not exist on any ancestor of grab_window.
136 The interpretation of the remaining arguments is as for
137 XIGrabDevice. The active grab is terminated automatically when
138 the logical state of the device has all buttons or keys
139 released (independent of the logical state of the modifier
142 If the device is an attached slave device, the device is
143 automatically detached from the master device when the grab
144 activates and reattached to the same master device when the
145 grab deactivates. If the master device is removed while the
146 device is floating as a result of a grab, the device remains
147 floating once the grab deactivates.
149 Note that the logical state of a device (as seen by client
150 applications) may lag the physical state if device event
151 processing is frozen.
153 This request overrides all previous grabs by the same client on
154 the same button/modifier or keycode/modifier combinations on the
155 same window. A modifiers of XIAnyModifier is equivalent to
156 issuing the grab request for all possible modifier combinations
157 (including the combination of no modifiers). It is not required
158 that all modifiers specified have currently assigned KeyCodes.
159 A button of XIAnyButton is equivalent to issuing the request
160 for all possible buttons. Otherwise, it is not required that
161 the specified button currently be assigned to a physical
164 If some other client has already issued a XIGrabButton or
165 XIGrabKeycode with the same button/modifier or keycode/modifier
166 combination on the same window, a BadAccess error results. When
167 using XIAnyModifier or XIAnyButton , the request fails
168 completely, and a XIBadAccess error results (no grabs are
169 established) if there is a conflicting grab for any
170 combination. XIGrabButton and XIGrabKeycode have no effect on an
173 On success, XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return 0;
174 If one or more modifier combinations could not be grabbed,
175 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of
176 failed combinations and modifiers_inout contains the failed combinations
177 and their respective error codes.
179 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin can generate BadClass,
180 BadDevice, BadMatch, BadValue, and BadWindow errors.
182 XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin release the
183 passive grab for a button/modifier, keycode/modifier or touch/modifier
184 combination on the specified window if it was grabbed by this client. A
185 modifier of XIAnyModifier is equivalent to issuing the ungrab request
186 for all possible modifier combinations, including the
187 combination of no modifiers. A button of XIAnyButton is
188 equivalent to issuing the request for all possible buttons.
189 XIUngrabButton and XIUngrabKeycode have no effect on an active
192 XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin can generate
193 BadDevice, BadMatch, BadValue and BadWindow errors.
197 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of
198 modifier combination that could not establish a passive grab. The
199 modifiers are returned in modifiers_inout, along with the respective
200 error for this modifier combination. If XIGrabButton, XIGrabKeycode
201 or XIGrabTouchBegin return zero, passive grabs with all requested
202 modifier combinations were established successfully.
208 An invalid deviceid was specified.
211 This error may occur if XIGrabButton specified a device
212 that has no buttons, or XIGrabKeycode specified a device
213 that has no keys, or XIGrabTouchBegin specified a device
214 that is not touch-capable.
217 Some numeric value falls outside the range of values
218 accepted by the request. Unless a specific range is
219 specified for an argument, the full range defined by the
220 argument's type is accepted. Any argument defined as a
221 set of alternatives can generate this error.
224 A value for a Window argument does not name a defined
230 The protocol headers for XI 2.0 did not provide
231 XIGrabModeAsync or XIGrabModeSync. Use GrabModeSync and
232 GrabModeAsync instead, respectively.
237 XIAllowEvents(libmansuffix)