1XGETDEVICEKEYMAPPING(3)                                XGETDEVICEKEYMAPPING(3)
2
3
4

NAME

6       XGetDeviceKeyMapping, XChangeDeviceKeyMapping - query or change device
7       key mappings
8

SYNOPSIS

10       #include <X11/extensions/XInput.h>
11
12       KeySym *XGetDeviceKeyMapping( Display *display,
13                                     XDevice *device,
14                                     KeyCode first_keycode,
15                                     int keycode_count,
16                                     int *keysyms_per_keycode_return);
17       display
18              Specifies the connection to the X server.
19
20       device
21              Specifies the device whose key mapping is to be queried
22              or modified.
23
24       first_keycode
25              Specifies the first KeyCode to be returned.
26
27       keycode_count
28              Specifies the number of KeyCodes to be returned or
29              modified.
30
31       keysyms_per_keycode
32              Specifies the number of KeySyms per KeyCode.
33
34       keysyms_per_keycode_return
35              Specifies the address of a variable into which the
36              number of KeySyms per KeyCode will be returned.
37
38       keysyms
39              Specifies the address of an array of KeySyms.
40

DESCRIPTION

42           For the specified device, the XGetDeviceKeyMapping request
43           returns the symbols for the specified number of KeyCodes
44           starting with first_keycode. The value specified in
45           first_keycode must be greater than or equal to min_keycode as
46           returned by XListInputDevices, or a BadValue error results. In
47           addition, the following expression must be less than or equal
48           to max_keycode as returned by XListInputDevices:
49
50           first_keycode + keycode_count - 1
51
52           If this is not the case, a BadValue error results. The number
53           of elements in the KeySyms list is:
54
55           keycode_count * keysyms_per_keycode_return
56
57           KeySym number N, counting from zero, for KeyCode K has the
58           following index in the list, counting from zero: (K -
59           first_code) * keysyms_per_code_return + N
60
61           The X server arbitrarily chooses the keysyms_per_keycode_return
62           value to be large enough to report all requested symbols. A
63           special KeySym value of NoSymbol is used to fill in unused
64           elements for individual KeyCodes. To free the storage returned
65           by XGetDeviceKeyMapping, use XFree.
66
67           If the specified device does not support input class keys, a
68           BadMatch error will result.
69
70           XGetDeviceKeyMapping can generate a BadDevice, BadMatch, or
71           BadValue error.
72
73           For the specified device, the XChangeDeviceKeyMapping request
74           defines the symbols for the specified number of KeyCodes
75           starting with first_keycode. The symbols for KeyCodes outside
76           this range remain unchanged. The number of elements in keysyms
77           must be:
78
79           num_codes * keysyms_per_keycode
80
81           The specified first_keycode must be greater than or equal to
82           min_keycode returned by XListInputDevices, or a BadValue error
83           results. In addition, the following expression must be less
84           than or equal to max_keycode as returned by XListInputDevices,
85           or a BadValue error results:
86
87           first_keycode + num_codes - 1
88
89           KeySym number N, counting from zero, for KeyCode K has the
90           following index in keysyms, counting from zero:
91
92           (K - first_keycode) * keysyms_per_keycode + N
93
94           The specified keysyms_per_keycode can be chosen arbitrarily by
95           the client to be large enough to hold all desired symbols. A
96           special KeySym value of NoSymbol should be used to fill in
97           unused elements for individual KeyCodes. It is legal for
98           NoSymbol to appear in nontrailing positions of the effective
99           list for a KeyCode. XChangeDeviceKeyMapping generates a
100           DeviceMappingNotify event that is sent to all clients that have
101           selected that type of event.
102
103           There is no requirement that the X server interpret this
104           mapping. It is merely stored for reading and writing by
105           clients.
106
107           If the specified device does not support input class keys, a
108           BadMatch error results.
109
110           XChangeDeviceKeyMapping can generate a BadDevice, BadMatch,
111           BadAlloc, or BadValue error.
112

DIAGNOSTICS

114           BadDevice
115                  An invalid device was specified. The specified device
116                  does not exist or has not been opened by this client via
117                  XOpenInputDevice. This error may also occur if the
118                  specified device is the X keyboard or X pointer device.
119
120           BadMatch
121                  This error may occur if an XGetDeviceKeyMapping or
122                  XChangeDeviceKeyMapping request was made specifying a
123                  device that has no keys.
124
125           BadValue
126                  Some numeric value falls outside the range of values
127                  accepted by the request. Unless a specific range is
128                  specified for an argument, the full range defined by the
129                  argument's type is accepted. Any argument defined as a
130                  set of alternatives can generate this error.
131
132           BadAlloc
133                  The server failed to allocate the requested resource or
134                  server memory.
135

SEE ALSO

137           XSetDeviceButtonMapping(3), XSetDeviceModifierMapping(__3_)
138
139
140
141                                  09/15/2021           XGETDEVICEKEYMAPPING(3)
Impressum