| 1 |
'\" t |
| 2 |
.\" Title: xgrabdevicekey |
| 3 |
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] |
| 4 |
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> |
| 5 |
.\" Date: 09/05/2024 |
| 6 |
.\" Manual: \ \& |
| 7 |
.\" Source: \ \& |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "XGRABDEVICEKEY" "libmansuffix" "09/05/2024" "\ \&" "\ \&" |
| 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 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
XGrabDeviceKey, XUngrabDeviceKey \- grab/ungrab extension input device Keys |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.nf |
| 35 |
#include <X11/extensions/XInput\&.h> |
| 36 |
.fi |
| 37 |
.sp |
| 38 |
.nf |
| 39 |
int XGrabDeviceKey( Display *display, |
| 40 |
XDevice *device, |
| 41 |
unsigned int key, |
| 42 |
unsigned int modifiers, |
| 43 |
XDevice *modifier_device, |
| 44 |
Window grab_window, |
| 45 |
Bool owner_events, |
| 46 |
unsigned int event_count, |
| 47 |
XEventClass *event_list, |
| 48 |
int this_device_mode, |
| 49 |
int other_devices_mode); |
| 50 |
.fi |
| 51 |
.sp |
| 52 |
.nf |
| 53 |
int XUngrabDeviceKey( Display *display, |
| 54 |
XDevice *device, |
| 55 |
unsigned int key, |
| 56 |
unsigned int modifiers, |
| 57 |
XDevice *modifier_device, |
| 58 |
Window grab_window); |
| 59 |
.fi |
| 60 |
.sp |
| 61 |
.nf |
| 62 |
display |
| 63 |
Specifies the connection to the X server\&. |
| 64 |
.fi |
| 65 |
.sp |
| 66 |
.nf |
| 67 |
device |
| 68 |
Specifies the device that is to be grabbed or released\&. |
| 69 |
.fi |
| 70 |
.sp |
| 71 |
.nf |
| 72 |
Key |
| 73 |
Specifies the device Key that is to be grabbed released |
| 74 |
or AnyKey\&. |
| 75 |
.fi |
| 76 |
.sp |
| 77 |
.nf |
| 78 |
modifiers |
| 79 |
Specifies the set of keymasks or AnyModifier\&. The mask is |
| 80 |
the bitwise inclusive OR of the valid keymask bits\&. Valid |
| 81 |
bits are: ShiftMask, LockMask, ControlMask, Mod1Mask, |
| 82 |
Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask\&. |
| 83 |
.fi |
| 84 |
.sp |
| 85 |
.nf |
| 86 |
modifier_device |
| 87 |
Specifies the device whose modifiers are to be used\&. If |
| 88 |
a modifier_device of NULL is specified, the X keyboard |
| 89 |
will be used as the modifier_device\&. |
| 90 |
.fi |
| 91 |
.sp |
| 92 |
.nf |
| 93 |
grab_window |
| 94 |
Specifies the grab window\&. |
| 95 |
.fi |
| 96 |
.sp |
| 97 |
.nf |
| 98 |
owner_events |
| 99 |
Specifies a Boolean value that indicates whether the |
| 100 |
device events are to be reported as usual or reported |
| 101 |
with respect to the grab window if selected by the event |
| 102 |
list\&. |
| 103 |
.fi |
| 104 |
.sp |
| 105 |
.nf |
| 106 |
event_count |
| 107 |
Specifies the number of event classes in the event list\&. |
| 108 |
.fi |
| 109 |
.sp |
| 110 |
.nf |
| 111 |
event_list |
| 112 |
Specifies which device events are reported to the |
| 113 |
client\&. |
| 114 |
.fi |
| 115 |
.sp |
| 116 |
.nf |
| 117 |
this_device_mode |
| 118 |
Specifies further processing of events from this |
| 119 |
device\&. You can pass GrabModeSync or GrabModeAsync\&. |
| 120 |
.fi |
| 121 |
.sp |
| 122 |
.nf |
| 123 |
other_devices_mode |
| 124 |
Specifies further processing of events from other |
| 125 |
devices\&. You can pass GrabModeSync or GrabModeAsync\&. |
| 126 |
.fi |
| 127 |
.SH "DESCRIPTION" |
| 128 |
.sp |
| 129 |
.if n \{\ |
| 130 |
.RS 4 |
| 131 |
.\} |
| 132 |
.nf |
| 133 |
The XGrabDeviceKey request establishes a passive grab\&. In the |
| 134 |
future, the device is actively grabbed (as for XGrabDevice, the |
| 135 |
last\-device\-grab time is set to the time at which the Key was |
| 136 |
pressed (as transmitted in the DeviceKeyPress event), and the |
| 137 |
DeviceKeyPress event is reported if all of the following |
| 138 |
conditions are true: |
| 139 |
* The device is not grabbed, and the specified key is |
| 140 |
logically pressed when the specified modifier keys are |
| 141 |
logically down, and no other keys or modifier keys are |
| 142 |
logically down\&. |
| 143 |
* The grab_window is an ancestor (or is) the focus window OR |
| 144 |
the grab window is a descendant of the focus window and |
| 145 |
contains the device\&. |
| 146 |
* The confine_to window (if any) is viewable\&. |
| 147 |
* A passive grab on the same key/modifier combination does |
| 148 |
not exist on any ancestor of grab_window\&. |
| 149 |
.fi |
| 150 |
.if n \{\ |
| 151 |
.RE |
| 152 |
.\} |
| 153 |
.sp |
| 154 |
.if n \{\ |
| 155 |
.RS 4 |
| 156 |
.\} |
| 157 |
.nf |
| 158 |
The interpretation of the remaining arguments is as for |
| 159 |
XGrabDevice\&. The active grab is terminated automatically when |
| 160 |
the logical state of the device has the specified key released\&. |
| 161 |
.fi |
| 162 |
.if n \{\ |
| 163 |
.RE |
| 164 |
.\} |
| 165 |
.sp |
| 166 |
.if n \{\ |
| 167 |
.RS 4 |
| 168 |
.\} |
| 169 |
.nf |
| 170 |
Note that the logical state of a device (as seen by means of |
| 171 |
the X protocol ) may lag the physical state if device event |
| 172 |
processing is frozen\&. |
| 173 |
.fi |
| 174 |
.if n \{\ |
| 175 |
.RE |
| 176 |
.\} |
| 177 |
.sp |
| 178 |
.if n \{\ |
| 179 |
.RS 4 |
| 180 |
.\} |
| 181 |
.nf |
| 182 |
If the key is not AnyKey, it must be in the range specified by |
| 183 |
min_keycode and max_keycode as returned by the |
| 184 |
XListInputDevices request\&. Otherwise, a BadValue error results\&. |
| 185 |
.fi |
| 186 |
.if n \{\ |
| 187 |
.RE |
| 188 |
.\} |
| 189 |
.sp |
| 190 |
.if n \{\ |
| 191 |
.RS 4 |
| 192 |
.\} |
| 193 |
.nf |
| 194 |
This request overrides all previous grabs by the same client on |
| 195 |
the same Key/modifier combinations on the same window\&. A |
| 196 |
modifier of AnyModifier is equivalent to issuing the grab |
| 197 |
request for all possible modifier combinations (including the |
| 198 |
combination of no modifiers)\&. It is not required that all |
| 199 |
modifiers specified have currently assigned KeyCodes\&. A key of |
| 200 |
AnyKey is equivalent to issuing the request for all possible |
| 201 |
keys\&. Otherwise, it is not required that the specified key |
| 202 |
currently be assigned to a physical Key\&. |
| 203 |
.fi |
| 204 |
.if n \{\ |
| 205 |
.RE |
| 206 |
.\} |
| 207 |
.sp |
| 208 |
.if n \{\ |
| 209 |
.RS 4 |
| 210 |
.\} |
| 211 |
.nf |
| 212 |
If a modifier_device of NULL is specified, the X keyboard will |
| 213 |
be used as the modifier_device\&. |
| 214 |
.fi |
| 215 |
.if n \{\ |
| 216 |
.RE |
| 217 |
.\} |
| 218 |
.sp |
| 219 |
.if n \{\ |
| 220 |
.RS 4 |
| 221 |
.\} |
| 222 |
.nf |
| 223 |
If some other client has already issued a XGrabDeviceKey with |
| 224 |
the same Key/modifier combination on the same window, a |
| 225 |
BadAccess error results\&. When using AnyModifier or AnyKey, the |
| 226 |
request fails completely, and a BadAccess error results (no |
| 227 |
grabs are established) if there is a conflicting grab for any |
| 228 |
combination\&. XGrabDeviceKey has no effect on an active grab\&. |
| 229 |
.fi |
| 230 |
.if n \{\ |
| 231 |
.RE |
| 232 |
.\} |
| 233 |
.sp |
| 234 |
.if n \{\ |
| 235 |
.RS 4 |
| 236 |
.\} |
| 237 |
.nf |
| 238 |
XGrabDeviceKey can generate BadAccess, BadClass, BadDevice, |
| 239 |
BadMatch, BadValue, and BadWindow errors\&. It returns Success on |
| 240 |
successful completion of the request\&. |
| 241 |
.fi |
| 242 |
.if n \{\ |
| 243 |
.RE |
| 244 |
.\} |
| 245 |
.sp |
| 246 |
.if n \{\ |
| 247 |
.RS 4 |
| 248 |
.\} |
| 249 |
.nf |
| 250 |
The XUngrabDeviceKey request releases the passive grab for a |
| 251 |
key/modifier combination on the specified window if it was |
| 252 |
grabbed by this client\&. A modifier of AnyModifier is equivalent |
| 253 |
to issuing the ungrab request for all possible modifier |
| 254 |
combinations, including the combination of no modifiers\&. A Key |
| 255 |
of AnyKey is equivalent to issuing the request for all possible |
| 256 |
Keys\&. XUngrabDeviceKey has no effect on an active grab\&. |
| 257 |
.fi |
| 258 |
.if n \{\ |
| 259 |
.RE |
| 260 |
.\} |
| 261 |
.sp |
| 262 |
.if n \{\ |
| 263 |
.RS 4 |
| 264 |
.\} |
| 265 |
.nf |
| 266 |
If a modifier_device of NULL is specified, the X keyboard will |
| 267 |
be used as the modifier_device\&. |
| 268 |
.fi |
| 269 |
.if n \{\ |
| 270 |
.RE |
| 271 |
.\} |
| 272 |
.sp |
| 273 |
.if n \{\ |
| 274 |
.RS 4 |
| 275 |
.\} |
| 276 |
.nf |
| 277 |
XUngrabDeviceKey can generate BadDevice, BadMatch, BadValue and |
| 278 |
BadWindow errors\&. |
| 279 |
.fi |
| 280 |
.if n \{\ |
| 281 |
.RE |
| 282 |
.\} |
| 283 |
.SH "DIAGNOSTICS" |
| 284 |
.sp |
| 285 |
.if n \{\ |
| 286 |
.RS 4 |
| 287 |
.\} |
| 288 |
.nf |
| 289 |
BadDevice |
| 290 |
An invalid device was specified\&. The specified device |
| 291 |
does not exist or has not been opened by this client via |
| 292 |
XOpenInputDevice\&. This error may also occur if the |
| 293 |
specified device is the X keyboard or X pointer device\&. |
| 294 |
.fi |
| 295 |
.if n \{\ |
| 296 |
.RE |
| 297 |
.\} |
| 298 |
.sp |
| 299 |
.if n \{\ |
| 300 |
.RS 4 |
| 301 |
.\} |
| 302 |
.nf |
| 303 |
BadMatch |
| 304 |
This error may occur if an XGrabDeviceKey request was |
| 305 |
made specifying a device that has no keys, or a modifier |
| 306 |
device that has no keys\&. |
| 307 |
.fi |
| 308 |
.if n \{\ |
| 309 |
.RE |
| 310 |
.\} |
| 311 |
.sp |
| 312 |
.if n \{\ |
| 313 |
.RS 4 |
| 314 |
.\} |
| 315 |
.nf |
| 316 |
BadValue |
| 317 |
Some numeric value falls outside the range of values |
| 318 |
accepted by the request\&. Unless a specific range is |
| 319 |
specified for an argument, the full range defined by the |
| 320 |
argument\*(Aqs type is accepted\&. Any argument defined as a |
| 321 |
set of alternatives can generate this error\&. |
| 322 |
.fi |
| 323 |
.if n \{\ |
| 324 |
.RE |
| 325 |
.\} |
| 326 |
.sp |
| 327 |
.if n \{\ |
| 328 |
.RS 4 |
| 329 |
.\} |
| 330 |
.nf |
| 331 |
BadWindow |
| 332 |
A value for a Window argument does not name a defined |
| 333 |
Window\&. |
| 334 |
.fi |
| 335 |
.if n \{\ |
| 336 |
.RE |
| 337 |
.\} |
| 338 |
.SH "SEE ALSO" |
| 339 |
.sp |
| 340 |
.if n \{\ |
| 341 |
.RS 4 |
| 342 |
.\} |
| 343 |
.nf |
| 344 |
XAllowDeviceEvents(libmansuffix), XGrabDevice(libmansuffix), XGrabDeviceButton(libmansuffix) |
| 345 |
.fi |
| 346 |
.if n \{\ |
| 347 |
.RE |
| 348 |
.\} |