| 1 |
'\" t |
| 2 |
.\" Title: xgetdevicekeymapping |
| 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 "XGETDEVICEKEYMAPPING" "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 |
XGetDeviceKeyMapping, XChangeDeviceKeyMapping \- query or change device key mappings |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.nf |
| 35 |
#include <X11/extensions/XInput\&.h> |
| 36 |
.fi |
| 37 |
.sp |
| 38 |
.nf |
| 39 |
KeySym *XGetDeviceKeyMapping( Display *display, |
| 40 |
XDevice *device, |
| 41 |
KeyCode first_keycode, |
| 42 |
int keycode_count, |
| 43 |
int *keysyms_per_keycode_return); |
| 44 |
display |
| 45 |
Specifies the connection to the X server\&. |
| 46 |
.fi |
| 47 |
.sp |
| 48 |
.nf |
| 49 |
device |
| 50 |
Specifies the device whose key mapping is to be queried |
| 51 |
or modified\&. |
| 52 |
.fi |
| 53 |
.sp |
| 54 |
.nf |
| 55 |
first_keycode |
| 56 |
Specifies the first KeyCode to be returned\&. |
| 57 |
.fi |
| 58 |
.sp |
| 59 |
.nf |
| 60 |
keycode_count |
| 61 |
Specifies the number of KeyCodes to be returned or |
| 62 |
modified\&. |
| 63 |
.fi |
| 64 |
.sp |
| 65 |
.nf |
| 66 |
keysyms_per_keycode |
| 67 |
Specifies the number of KeySyms per KeyCode\&. |
| 68 |
.fi |
| 69 |
.sp |
| 70 |
.nf |
| 71 |
keysyms_per_keycode_return |
| 72 |
Specifies the address of a variable into which the |
| 73 |
number of KeySyms per KeyCode will be returned\&. |
| 74 |
.fi |
| 75 |
.sp |
| 76 |
.nf |
| 77 |
keysyms |
| 78 |
Specifies the address of an array of KeySyms\&. |
| 79 |
.fi |
| 80 |
.SH "DESCRIPTION" |
| 81 |
.sp |
| 82 |
.if n \{\ |
| 83 |
.RS 4 |
| 84 |
.\} |
| 85 |
.nf |
| 86 |
For the specified device, the XGetDeviceKeyMapping request |
| 87 |
returns the symbols for the specified number of KeyCodes |
| 88 |
starting with first_keycode\&. The value specified in |
| 89 |
first_keycode must be greater than or equal to min_keycode as |
| 90 |
returned by XListInputDevices, or a BadValue error results\&. In |
| 91 |
addition, the following expression must be less than or equal |
| 92 |
to max_keycode as returned by XListInputDevices: |
| 93 |
.fi |
| 94 |
.if n \{\ |
| 95 |
.RE |
| 96 |
.\} |
| 97 |
.sp |
| 98 |
.if n \{\ |
| 99 |
.RS 4 |
| 100 |
.\} |
| 101 |
.nf |
| 102 |
first_keycode + keycode_count \- 1 |
| 103 |
.fi |
| 104 |
.if n \{\ |
| 105 |
.RE |
| 106 |
.\} |
| 107 |
.sp |
| 108 |
.if n \{\ |
| 109 |
.RS 4 |
| 110 |
.\} |
| 111 |
.nf |
| 112 |
If this is not the case, a BadValue error results\&. The number |
| 113 |
of elements in the KeySyms list is: |
| 114 |
.fi |
| 115 |
.if n \{\ |
| 116 |
.RE |
| 117 |
.\} |
| 118 |
.sp |
| 119 |
.if n \{\ |
| 120 |
.RS 4 |
| 121 |
.\} |
| 122 |
.nf |
| 123 |
keycode_count * keysyms_per_keycode_return |
| 124 |
.fi |
| 125 |
.if n \{\ |
| 126 |
.RE |
| 127 |
.\} |
| 128 |
.sp |
| 129 |
.if n \{\ |
| 130 |
.RS 4 |
| 131 |
.\} |
| 132 |
.nf |
| 133 |
KeySym number N, counting from zero, for KeyCode K has the |
| 134 |
following index in the list, counting from zero: (K \- |
| 135 |
first_code) * keysyms_per_code_return + N |
| 136 |
.fi |
| 137 |
.if n \{\ |
| 138 |
.RE |
| 139 |
.\} |
| 140 |
.sp |
| 141 |
.if n \{\ |
| 142 |
.RS 4 |
| 143 |
.\} |
| 144 |
.nf |
| 145 |
The X server arbitrarily chooses the keysyms_per_keycode_return |
| 146 |
value to be large enough to report all requested symbols\&. A |
| 147 |
special KeySym value of NoSymbol is used to fill in unused |
| 148 |
elements for individual KeyCodes\&. To free the storage returned |
| 149 |
by XGetDeviceKeyMapping, use XFree\&. |
| 150 |
.fi |
| 151 |
.if n \{\ |
| 152 |
.RE |
| 153 |
.\} |
| 154 |
.sp |
| 155 |
.if n \{\ |
| 156 |
.RS 4 |
| 157 |
.\} |
| 158 |
.nf |
| 159 |
If the specified device does not support input class keys, a |
| 160 |
BadMatch error will result\&. |
| 161 |
.fi |
| 162 |
.if n \{\ |
| 163 |
.RE |
| 164 |
.\} |
| 165 |
.sp |
| 166 |
.if n \{\ |
| 167 |
.RS 4 |
| 168 |
.\} |
| 169 |
.nf |
| 170 |
XGetDeviceKeyMapping can generate a BadDevice, BadMatch, or |
| 171 |
BadValue error\&. |
| 172 |
.fi |
| 173 |
.if n \{\ |
| 174 |
.RE |
| 175 |
.\} |
| 176 |
.sp |
| 177 |
.if n \{\ |
| 178 |
.RS 4 |
| 179 |
.\} |
| 180 |
.nf |
| 181 |
For the specified device, the XChangeDeviceKeyMapping request |
| 182 |
defines the symbols for the specified number of KeyCodes |
| 183 |
starting with first_keycode\&. The symbols for KeyCodes outside |
| 184 |
this range remain unchanged\&. The number of elements in keysyms |
| 185 |
must be: |
| 186 |
.fi |
| 187 |
.if n \{\ |
| 188 |
.RE |
| 189 |
.\} |
| 190 |
.sp |
| 191 |
.if n \{\ |
| 192 |
.RS 4 |
| 193 |
.\} |
| 194 |
.nf |
| 195 |
num_codes * keysyms_per_keycode |
| 196 |
.fi |
| 197 |
.if n \{\ |
| 198 |
.RE |
| 199 |
.\} |
| 200 |
.sp |
| 201 |
.if n \{\ |
| 202 |
.RS 4 |
| 203 |
.\} |
| 204 |
.nf |
| 205 |
The specified first_keycode must be greater than or equal to |
| 206 |
min_keycode returned by XListInputDevices, or a BadValue error |
| 207 |
results\&. In addition, the following expression must be less |
| 208 |
than or equal to max_keycode as returned by XListInputDevices, |
| 209 |
or a BadValue error results: |
| 210 |
.fi |
| 211 |
.if n \{\ |
| 212 |
.RE |
| 213 |
.\} |
| 214 |
.sp |
| 215 |
.if n \{\ |
| 216 |
.RS 4 |
| 217 |
.\} |
| 218 |
.nf |
| 219 |
first_keycode + num_codes \- 1 |
| 220 |
.fi |
| 221 |
.if n \{\ |
| 222 |
.RE |
| 223 |
.\} |
| 224 |
.sp |
| 225 |
.if n \{\ |
| 226 |
.RS 4 |
| 227 |
.\} |
| 228 |
.nf |
| 229 |
KeySym number N, counting from zero, for KeyCode K has the |
| 230 |
following index in keysyms, counting from zero: |
| 231 |
.fi |
| 232 |
.if n \{\ |
| 233 |
.RE |
| 234 |
.\} |
| 235 |
.sp |
| 236 |
.if n \{\ |
| 237 |
.RS 4 |
| 238 |
.\} |
| 239 |
.nf |
| 240 |
(K \- first_keycode) * keysyms_per_keycode + N |
| 241 |
.fi |
| 242 |
.if n \{\ |
| 243 |
.RE |
| 244 |
.\} |
| 245 |
.sp |
| 246 |
.if n \{\ |
| 247 |
.RS 4 |
| 248 |
.\} |
| 249 |
.nf |
| 250 |
The specified keysyms_per_keycode can be chosen arbitrarily by |
| 251 |
the client to be large enough to hold all desired symbols\&. A |
| 252 |
special KeySym value of NoSymbol should be used to fill in |
| 253 |
unused elements for individual KeyCodes\&. It is legal for |
| 254 |
NoSymbol to appear in nontrailing positions of the effective |
| 255 |
list for a KeyCode\&. XChangeDeviceKeyMapping generates a |
| 256 |
DeviceMappingNotify event that is sent to all clients that have |
| 257 |
selected that type of event\&. |
| 258 |
.fi |
| 259 |
.if n \{\ |
| 260 |
.RE |
| 261 |
.\} |
| 262 |
.sp |
| 263 |
.if n \{\ |
| 264 |
.RS 4 |
| 265 |
.\} |
| 266 |
.nf |
| 267 |
There is no requirement that the X server interpret this |
| 268 |
mapping\&. It is merely stored for reading and writing by |
| 269 |
clients\&. |
| 270 |
.fi |
| 271 |
.if n \{\ |
| 272 |
.RE |
| 273 |
.\} |
| 274 |
.sp |
| 275 |
.if n \{\ |
| 276 |
.RS 4 |
| 277 |
.\} |
| 278 |
.nf |
| 279 |
If the specified device does not support input class keys, a |
| 280 |
BadMatch error results\&. |
| 281 |
.fi |
| 282 |
.if n \{\ |
| 283 |
.RE |
| 284 |
.\} |
| 285 |
.sp |
| 286 |
.if n \{\ |
| 287 |
.RS 4 |
| 288 |
.\} |
| 289 |
.nf |
| 290 |
XChangeDeviceKeyMapping can generate a BadDevice, BadMatch, |
| 291 |
BadAlloc, or BadValue error\&. |
| 292 |
.fi |
| 293 |
.if n \{\ |
| 294 |
.RE |
| 295 |
.\} |
| 296 |
.SH "DIAGNOSTICS" |
| 297 |
.sp |
| 298 |
.if n \{\ |
| 299 |
.RS 4 |
| 300 |
.\} |
| 301 |
.nf |
| 302 |
BadDevice |
| 303 |
An invalid device was specified\&. The specified device |
| 304 |
does not exist or has not been opened by this client via |
| 305 |
XOpenInputDevice\&. This error may also occur if the |
| 306 |
specified device is the X keyboard or X pointer device\&. |
| 307 |
.fi |
| 308 |
.if n \{\ |
| 309 |
.RE |
| 310 |
.\} |
| 311 |
.sp |
| 312 |
.if n \{\ |
| 313 |
.RS 4 |
| 314 |
.\} |
| 315 |
.nf |
| 316 |
BadMatch |
| 317 |
This error may occur if an XGetDeviceKeyMapping or |
| 318 |
XChangeDeviceKeyMapping request was made specifying a |
| 319 |
device that has no keys\&. |
| 320 |
.fi |
| 321 |
.if n \{\ |
| 322 |
.RE |
| 323 |
.\} |
| 324 |
.sp |
| 325 |
.if n \{\ |
| 326 |
.RS 4 |
| 327 |
.\} |
| 328 |
.nf |
| 329 |
BadValue |
| 330 |
Some numeric value falls outside the range of values |
| 331 |
accepted by the request\&. Unless a specific range is |
| 332 |
specified for an argument, the full range defined by the |
| 333 |
argument\*(Aqs type is accepted\&. Any argument defined as a |
| 334 |
set of alternatives can generate this error\&. |
| 335 |
.fi |
| 336 |
.if n \{\ |
| 337 |
.RE |
| 338 |
.\} |
| 339 |
.sp |
| 340 |
.if n \{\ |
| 341 |
.RS 4 |
| 342 |
.\} |
| 343 |
.nf |
| 344 |
BadAlloc |
| 345 |
The server failed to allocate the requested resource or |
| 346 |
server memory\&. |
| 347 |
.fi |
| 348 |
.if n \{\ |
| 349 |
.RE |
| 350 |
.\} |
| 351 |
.SH "SEE ALSO" |
| 352 |
.sp |
| 353 |
.if n \{\ |
| 354 |
.RS 4 |
| 355 |
.\} |
| 356 |
.nf |
| 357 |
XSetDeviceButtonMapping(libmansuffix), XSetDeviceModifierMapping(__libmansuffix_) |
| 358 |
.fi |
| 359 |
.if n \{\ |
| 360 |
.RE |
| 361 |
.\} |