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..P The XUngrabDeviceButton
123 request releases the passive grab for a button/modifier
124 combination on the specified window if it was grabbed by this
125 client. A modifier of AnyModifier is equivalent to issuing the
126 ungrab request for all possible modifier combinations,
127 including the combination of no modifiers. A button of
128 AnyButton is equivalent to issuing the request for all possible
129 buttons. XUngrabDeviceButton has no effect on an active grab.
130
131 A modifier_device of NULL indicates that the X keyboard should
132 be used as the modifier_device.
133
134 XUngrabDeviceButton can generate BadDevice, BadMatch, BadValue
135 and BadWindow errors.
136
138 BadDevice
139 An invalid device was specified. The specified device
140 does not exist or has not been opened by this client via
141 XOpenInputDevice. This error may also occur if the
142 specified device is the X keyboard or X pointer device.
143
144 BadMatch
145 This error may occur if an XGrabDeviceButton request was
146 made specifying a device that has no buttons, or
147 specifying a modifier device that has no keys.
148
149 BadValue
150 Some numeric value falls outside the range of values
151 accepted by the request. Unless a specific range is
152 specified for an argument, the full range defined by the
153 argument's type is accepted. Any argument defined as a
154 set of alternatives can generate this error.
155
156 BadWindow
157 A value for a Window argument does not name a defined
158 Window.
159
161 XAllowDeviceEvents(3), XGrabDevice(3), XGrabDeviceKey(3)
162
163
164
165 06/19/2019 XGRABDEVICEBUTTON(3)