2 .\" Title: xigrabbutton
3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
6 .\" Manual: [FIXME: manual]
7 .\" Source: [FIXME: source]
10 .TH "XIGRABBUTTON" "libmansuffix" "12/22/2011" "[FIXME: source]" "[FIXME: manual]"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode \- grab/ungrab buttons or keys
35 #include <X11/extensions/XInput2\&.h>
39 int XIGrabButton( Display *display,
45 int paired_device_mode,
49 XIGrabModifiers *modifiers_inout);
53 int XIUngrabButton( Display *display,
58 XIGrabModifiers *modifiers);
62 int XIGrabKeycode( Display *display,
67 int paired_device_mode,
71 XIGrabModifiers *modifiers_inout);
75 int XIUngrabKeycode( Display *display,
80 XIGrabModifiers *modifiers);
84 int XIGrabTouchBegin( Display *display,
90 XIGrabModifiers *modifiers_inout);
94 int XIUngrabTouchBegin( Display *display,
98 XIGrabModifiers *modifiers);
103 Specifies the connection to the X server\&.
108 Specifies the device that is to be grabbed or released
113 Specifies the device button that is to be grabbed or
114 released or XIAnyButton\&.
119 Specifies the keycode that is to be grabbed or released
125 Number of elements in modifiers or modifiers_inout\&.
130 Specifies the set of latched and base modifiers or
131 XIAnyModifier to ungrab\&. The data type is for
132 consistency with the respective grab request and the
133 status code of the XIGrabModifiers struct is ignored\&.
138 Specifies the set of latched and base modifiers or
139 XIAnyModifier to grab\&. Returns the modifiers that could
140 not be grabbed and their error code\&.
145 Specifies the grab window\&.
150 Specifies a Boolean value that indicates whether the are
151 to be reported as usual or reported with respect to the
157 Specifies the event mask\&.
162 Specifies further processing of events from this device\&.
163 You can pass XIGrabModeSync or XIGrabModeAsync\&.
168 Specifies further processing of events from the paired
169 master device\&. You can pass XIGrabModeSync or
170 XIGrabModeAsync\&. If deviceid specifies a floating slave
171 device, this parameter is ignored\&.
179 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin establish a passive
180 grab\&. The modifier device for a button grab is the paired master device
181 if deviceid specifies a master pointer\&. Otherwise, the modifier
182 device is the device specified with deviceid\&. In the future,
183 the device is actively grabbed (as for XIGrabDevice, the
184 last\-grab time is set to the time at which the button or keycode
185 was pressed and the XI_ButtonPress or XI_KeyPress event is
186 reported if all of the following conditions are true:
187 * The device is not grabbed, and the specified button or
188 keycode is logically pressed or a touch event occurs when the
189 specified modifier keys are logically down on the modifier device
190 and no other buttons or modifier keys are logically down\&.
191 * Either the grab window is an ancestor of (or is) the focus
192 window, OR the grab window is a descendent of the focus
193 window and contains the device\&.
194 * A passive grab on the same button/modifier combination does
195 not exist on any ancestor of grab_window\&.
205 The interpretation of the remaining arguments is as for
206 XIGrabDevice\&. The active grab is terminated automatically when
207 the logical state of the device has all buttons or keys
208 released (independent of the logical state of the modifier
219 If the device is an attached slave device, the device is
220 automatically detached from the master device when the grab
221 activates and reattached to the same master device when the
222 grab deactivates\&. If the master device is removed while the
223 device is floating as a result of a grab, the device remains
224 floating once the grab deactivates\&.
234 Note that the logical state of a device (as seen by client
235 applications) may lag the physical state if device event
236 processing is frozen\&.
246 This request overrides all previous grabs by the same client on
247 the same button/modifier or keycode/modifier combinations on the
248 same window\&. A modifiers of XIAnyModifier is equivalent to
249 issuing the grab request for all possible modifier combinations
250 (including the combination of no modifiers)\&. It is not required
251 that all modifiers specified have currently assigned KeyCodes\&.
252 A button of XIAnyButton is equivalent to issuing the request
253 for all possible buttons\&. Otherwise, it is not required that
254 the specified button currently be assigned to a physical
265 If some other client has already issued a XIGrabButton or
266 XIGrabKeycode with the same button/modifier or keycode/modifier
267 combination on the same window, a BadAccess error results\&. When
268 using XIAnyModifier or XIAnyButton , the request fails
269 completely, and a XIBadAccess error results (no grabs are
270 established) if there is a conflicting grab for any
271 combination\&. XIGrabButton and XIGrabKeycode have no effect on an
282 On success, XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return 0;
283 If one or more modifier combinations could not be grabbed,
284 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of
285 failed combinations and modifiers_inout contains the failed combinations
286 and their respective error codes\&.
296 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin can generate BadClass,
297 BadDevice, BadMatch, BadValue, and BadWindow errors\&.
307 XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin release the
308 passive grab for a button/modifier, keycode/modifier or touch/modifier
309 combination on the specified window if it was grabbed by this client\&. A
310 modifier of XIAnyModifier is equivalent to issuing the ungrab request
311 for all possible modifier combinations, including the
312 combination of no modifiers\&. A button of XIAnyButton is
313 equivalent to issuing the request for all possible buttons\&.
314 XIUngrabButton and XIUngrabKeycode have no effect on an active
325 XIUngrabButton, XIUngrabKeycode and XIUngrabTouchBegin can generate
326 BadDevice, BadMatch, BadValue and BadWindow errors\&.
337 XIGrabButton, XIGrabKeycode and XIGrabTouchBegin return the number of
338 modifier combination that could not establish a passive grab\&. The
339 modifiers are returned in modifiers_inout, along with the respective
340 error for this modifier combination\&. If XIGrabButton, XIGrabKeycode
341 or XIGrabTouchBegin return zero, passive grabs with all requested
342 modifier combinations were established successfully\&.
354 An invalid deviceid was specified\&.
365 This error may occur if XIGrabButton specified a device
366 that has no buttons, or XIGrabKeycode specified a device
367 that has no keys, or XIGrabTouchBegin specified a device
368 that is not touch\-capable\&.
379 Some numeric value falls outside the range of values
380 accepted by the request\&. Unless a specific range is
381 specified for an argument, the full range defined by the
382 argument\*(Aqs type is accepted\&. Any argument defined as a
383 set of alternatives can generate this error\&.
394 A value for a Window argument does not name a defined
406 The protocol headers for XI 2\&.0 did not provide
407 XIGrabModeAsync or XIGrabModeSync\&. Use GrabModeSync and
408 GrabModeAsync instead, respectively\&.
419 XIAllowEvents(libmansuffix)