1XGrabDeviceButton(3) X FUNCTIONS XGrabDeviceButton(3)
2
3
4
6 XGrabDeviceButton, XUngrabDeviceButton - grab/ungrab extension input
7 device buttons
8
10
11
12 int XGrabDeviceButton(Display *display, XDevice *device,
13 unsigned int button, unsigned int modifiers, XDevice
14 *modifier_device, Window grab_window, Bool
15 owner_events, unsigned int event_count, XEventClass
16 *event_list, int this_device_mode, int
17 other_devices_mode);
18
19 int XUngrabDeviceButton(Display *display, XDevice *device,
20 unsigned int button, unsigned int modifiers, XDevice
21 *modifier_device, Window grab_window);
22
23
25 display Specifies the connection to the X server.
26
27 device Specifies the device that is to be grabbed or released
28
29 button Specifies the device button that is to be grabbed or
30 released or AnyButton.
31
32 modifiers Specifies the set of keymasks or AnyModifier. The mask is
33 the bitwise inclusive OR of the valid keymask bits. Valid
34 bits are: Shiftmask, LockMask, ControlMask, Mod1Mask,
35 Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask.
36
37 modifier_device
38 specifies the device whose modifiers are to be used. If
39 the modifier_device specified is NULL, the X keyboard will
40 be used as the modifier_device.
41
42 grab_window Specifies the grab window.
43
44 owner_events
45 Specifies a Boolean value that indicates whether the device
46 events are to be reported as usual or reported with respect
47 to the grab window if selected by the event list.
48
49 event_count Specifies the number of event classes in the event list.
50
51 event_list Specifies which events are reported to the client.
52
53 this_device_mode
54 Specifies further processing of events from this device.
55 You can pass GrabModeSync or GrabModeAsync.
56
57 other_devices_mode
58 Specifies further processing of events from all other
59 devices. You can pass GrabModeSync or GrabModeAsync.
60
62 The XGrabDeviceButton request establishes a passive grab. In the
63 future, the device is actively grabbed (as for XGrabDevice, the last-
64 grab time is set to the time at which the button was pressed (as trans‐
65 mitted in the DeviceButtonPress event), and the DeviceButtonPress event
66 is reported if all of the following conditions are true:
67
68 · The device is not grabbed, and the specified button is logically
69 pressed when the specified modifier keys are logically down on the
70 specified modifier device and no other buttons or modifier keys
71 are logically down.
72
73 · Either the grab window is an ancestor of (or is) the focus window,
74 OR the grab window is a descendent of the focus window and con‐
75 tains the device.
76
77 · A passive grab on the same button/modifier combination does not
78 exist on any ancestor of grab_window.
79
80 The interpretation of the remaining arguments is as for XGrabDevice.
81 The active grab is terminated automatically when the logical state of
82 the device has all buttons released (independent of the logical state
83 of the modifier keys).
84
85 Note that the logical state of a device (as seen by client applica‐
86 tions) may lag the physical state if device event processing is frozen.
87
88 This request overrides all previous grabs by the same client on the
89 same button/modifier combinations on the same window. A modifiers of
90 AnyModifier is equivalent to issuing the grab request for all possible
91 modifier combinations (including the combination of no modifiers). It
92 is not required that all modifiers specified have currently assigned
93 KeyCodes. A button of AnyButton is equivalent to issuing the request
94 for all possible buttons. Otherwise, it is not required that the spec‐
95 ified button currently be assigned to a physical button.
96
97 A modifier_device of NULL indicates that the X keyboard is to be used
98 as the modifier_device.
99
100 If some other client has already issued a XGrabDeviceButton with the
101 same button/modifier combination on the same window, a BadAccess error
102 results. When using AnyModifier or AnyButton , the request fails com‐
103 pletely, and a BadAccess error results (no grabs are established) if
104 there is a conflicting grab for any combination. XGrabDeviceButton has
105 no effect on an active grab.
106
107 XGrabDeviceButton can generate BadClass, BadDevice, BadMatch, BadValue,
108 and BadWindow errors.
109
110 The XUngrabDeviceButton request releases the passive grab for a but‐
111 ton/modifier combination on the specified window if it was grabbed by
112 this client. A modifier of AnyModifier is equivalent to issuing the
113 ungrab request for all possible modifier combinations, including the
114 combination of no modifiers. A button of AnyButton is equivalent to
115 issuing the request for all possible buttons. XUngrabDeviceButton has
116 no effect on an active grab.
117
118 A modifier_device of NULL indicates that the X keyboard should be used
119 as the modifier_device.
120
121 XUngrabDeviceButton can generate BadDevice, BadMatch, BadValue and Bad‐
122 Window errors.
123
125 BadDevice An invalid device was specified. The specified device does
126 not exist or has not been opened by this client via XOpen‐
127 InputDevice. This error may also occur if the specified
128 device is the X keyboard or X pointer device.
129
130 BadMatch This error may occur if an XGrabDeviceButton request was
131 made specifying a device that has no buttons, or specifying
132 a modifier device that has no keys.
133
134 BadValue Some numeric value falls outside the range of values
135 accepted by the request. Unless a specific range is speci‐
136 fied for an argument, the full range defined by the argu‐
137 ment's type is accepted. Any argument defined as a set of
138 alternatives can generate this error.
139
140 BadWindow A value for a Window argument does not name a defined Win‐
141 dow.
142
144 XAllowDeviceEvents(3),
145 XGrabDevice(3),
146 XGrabDeviceKey(3),
147 Programming With Xlib
148
149
150
151X Version 11 libXi 1.1.1 XGrabDeviceButton(3)