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