1XIGRABBUTTON(3) [FIXME: manual] XIGRABBUTTON(3)
2
3
4
6 XIGrabButton, XIUngrabButton, XIGrabKeycode, XIUngrabKeycode -
7 grab/ungrab buttons or keys
8
10 #include <X11/extensions/XInput.h>
11
12 int XIGrabButton( Display *display,
13 int deviceid,
14 int button,
15 Window grab_window,
16 Cursor cursor,
17 int grab_mode,
18 int paired_device_mode,
19 Bool owner_events,
20 XIEventMask *mask,
21 int num_modifiers,
22 XIGrabModifiers *modifiers_inout);
23
24 int XIUngrabButton( Display *display,
25 int deviceid,
26 int button,
27 Window grab_window,
28 int num_modifiers,
29 XIGrabModifiers *modifiers);
30
31 int XIGrabKeycode( Display *display,
32 int deviceid,
33 int keycode,
34 Window grab_window,
35 int grab_mode,
36 int paired_device_mode,
37 Bool owner_events,
38 XIEventMask *mask,
39 int num_modifiers,
40 XIGrabModifiers *modifiers_inout);
41
42 int XIUngrabKeycode( Display *display,
43 int deviceid,
44 int keycode,
45 Window grab_window,
46 int num_modifiers,
47 XIGrabModifiers *modifiers);
48
49 display
50 Specifies the connection to the X server.
51
52 device
53 Specifies the device that is to be grabbed or released
54
55 button
56 Specifies the device button that is to be grabbed or
57 released or XIAnyButton.
58
59 keycode
60 Specifies the keycode that is to be grabbed or released
61 or XIAnyKeycode.
62
63 num_modifiers
64 Number of elements in modifiers or modifiers_return
65
66 modifiers
67 Specifies the set of latched and base modifiers or
68 XIAnyModifier to ungrab. The data type is for
69 consistency with the respective grab request and the
70 status code of the XIGrabModifiers struct is ignored.
71
72 modifiers_inout
73 Specifies the set of latched and base modifiers or
74 XIAnyModifier to grab. Returns the modifiers that could
75 not be grabbed and their status code.
76
77 grab_window
78 Specifies the grab window.
79
80 owner_events
81 Specifies a Boolean value that indicates whether the are
82 to be reported as usual or reported with respect to the
83 grab window.
84
85 mask
86 Specifies the event mask.
87
88 grab_mode
89 Specifies further processing of events from this device.
90 You can pass GrabModeSync or GrabModeAsync.
91
92 paired_device_mode
93 Specifies further processing of events from the paired
94 master device. You can pass GrabModeSync or
95 GrabModeAsync. If deviceid specifies a floating slave
96 device, this parameter is ignored.
97
99 XIGrabButton and XIGrabKeycode establishes a passive grab. The
100 modifier device for a button grab is the paired master device
101 if deviceid specifies a master pointer. Otherwise, the modifier
102 device is the device specified with deviceid. In the future,
103 the device is actively grabbed (as for XIGrabDevice, the
104 last-grab time is set to the time at which the button or keycode
105 was pressed and the X_XIButtonPress or X_XIKeyPress event is
106 reported if all of the following conditions are true:
107 * The device is not grabbed, and the specified button or
108 keycode is logically pressed when the specified modifier
109 keys are logically down on the modifier device and no other
110 buttons or modifier keys are logically down.
111 * Either the grab window is an ancestor of (or is) the focus
112 window, OR the grab window is a descendent of the focus
113 window and contains the device.
114 * A passive grab on the same button/modifier combination does
115 not exist on any ancestor of grab_window.
116
117 The interpretation of the remaining arguments is as for
118 XIGrabDevice. The active grab is terminated automatically when
119 the logical state of the device has all buttons or keys
120 released (independent of the logical state of the modifier
121 keys).
122
123 If the device is an attached slave device, the device is
124 automatically detached from the master device when the grab
125 activates and reattached to the same master device when the
126 grab deactivates. If the master device is removed while the
127 device is floating as a result of a grab, the device remains
128 floating once the grab deactivates.
129
130 Note that the logical state of a device (as seen by client
131 applications) may lag the physical state if device event
132 processing is frozen.
133
134 This request overrides all previous grabs by the same client on
135 the same button/modifier or keycode/modifier combinations on the
136 same window. A modifiers of XIAnyModifier is equivalent to
137 issuing the grab request for all possible modifier combinations
138 (including the combination of no modifiers). It is not required
139 that all modifiers specified have currently assigned KeyCodes.
140 A button of XIAnyButton is equivalent to issuing the request
141 for all possible buttons. Otherwise, it is not required that
142 the specified button currently be assigned to a physical
143 button.
144
145 If some other client has already issued a XIGrabButton or
146 XIGrabKeycode with the same button/modifier or keycode/modifier
147 combination on the same window, a BadAccess error results. When
148 using XIAnyModifier or XIAnyButton , the request fails
149 completely, and a XIBadAccess error results (no grabs are
150 established) if there is a conflicting grab for any
151 combination. XIGrabButton and XIGrabKeycode have no effect on an
152 active grab.
153
154 XIGrabButton and XIGrabKeycode can generate BadClass, BadDevice,
155 BadMatch, BadValue, and BadWindow errors.
156
157 XIUngrabButton and XIUngrabKeycode releases the passive grab for
158 a button/modifier or keycode/modifier combination on the
159 specified window if it was grabbed by this client. A modifier
160 of XIAnyModifier is equivalent to issuing the ungrab request
161 for all possible modifier combinations, including the
162 combination of no modifiers. A button of XIAnyButton is
163 equivalent to issuing the request for all possible buttons.
164 XIUngrabButton and XIUngrabKeycode have no effect on an active
165 grab.
166
167 XIUngrabButton and XIUngrabKeycode can generate BadDevice,
168 BadMatch, BadValue and BadWindow errors.
169
171 BadDevice
172 An invalid deviceid was specified.
173
174 BadMatch
175 This error may occur if XIGrabButton specified a device
176 that has no buttons, or XIGrabKeycode specified a device
177 that has no keys.
178
179 BadValue
180 Some numeric value falls outside the range of values
181 accepted by the request. Unless a specific range is
182 specified for an argument, the full range defined by the
183 argumentĀ“s type is accepted. Any argument defined as a
184 set of alternatives can generate this error.
185
186 BadWindow
187 A value for a Window argument does not name a defined
188 Window.
189
191 XIAllowEvents(3)
192
193
194
195[FIXME: source] 08/04/2010 XIGRABBUTTON(3)