XGetDeviceKeyMapping.txt revision c27c18e8
1XGETDEVICEKEYMAPPING(libmansuffix)
2==================================
3
4NAME
5----
6
7   XGetDeviceKeyMapping, XChangeDeviceKeyMapping - query or change
8   device key mappings
9
10SYNOPSIS
11--------
12
13   #include <X11/extensions/XInput.h>
14
15   KeySym *XGetDeviceKeyMapping( Display *display,
16                                 XDevice *device,
17                                 KeyCode first_keycode,
18                                 int keycode_count,
19                                 int *keysyms_per_keycode_return);
20   display
21          Specifies the connection to the X server.
22
23   device
24          Specifies the device whose key mapping is to be queried
25          or modified.
26
27   first_keycode
28          Specifies the first KeyCode to be returned.
29
30   keycode_count
31          Specifies the number of KeyCodes to be returned or
32          modified.
33
34   keysyms_per_keycode
35          Specifies the number of KeySyms per KeyCode.
36
37   keysyms_per_keycode_return
38          Specifies the address of a variable into which the
39          number of KeySyms per KeyCodewill be returned.
40
41   keysyms
42          Specifies the address of an array of KeySyms.
43
44DESCRIPTION
45-----------
46
47   For the specified device, the XGetDeviceKeyMapping request
48   returns the symbols for the specified number of KeyCodes
49   starting with first_keycode. The value specified in
50   first_keycode must be greater than or equal to min_keycode as
51   returned by XListInputDevices, or a BadValue error results. In
52   addition, the following expression must be less than or equal
53   to max_keycode as returned by XListInputDevices:
54
55   first_keycode + keycode_count - 1
56
57   If this is not the case, a BadValue error results. The number
58   of elements in the KeySyms list is:
59
60   keycode_count * keysyms_per_keycode_return
61
62   KeySym number N, counting from zero, for KeyCode K has the
63   following index in the list, counting from zero: (K -
64   first_code) * keysyms_per_code_return + N
65
66   The X server arbitrarily chooses the keysyms_per_keycode_return
67   value to be large enough to report all requested symbols. A
68   special KeySym value of NoSymbol is used to fill in unused
69   elements for individual KeyCodes. To free the storage returned
70   by XGetDeviceKeyMapping, use XFree.
71
72   If the specified device does not support input class keys, a
73   BadMatch error will result.
74
75   XGetDeviceKeyMapping can generate a BadDevice, BadMatch, or
76   BadValue error.
77
78   For the specified device, the XChangeDeviceKeyMapping request
79   defines the symbols for the specified number of KeyCodes
80   starting with first_keycode. The symbols for KeyCodes outside
81   this range remain unchanged. The number of elements in keysyms
82   must be:
83
84   num_codes * keysyms_per_keycode
85
86   The specified first_keycode must be greater than or equal to
87   min_keycode returned by XListInputDevices, or a BadValue error
88   results. In addition, the following expression must be less
89   than or equal to max_keycode as returned by XListInputDevices,
90   or a BadValue error results:
91
92   first_keycode + num_codes - 1
93
94   KeySym number N, counting from zero, for KeyCode K has the
95   following index in keysyms, counting from zero:
96
97   (K - first_keycode) * keysyms_per_keycode + N
98
99   The specified keysyms_per_keycode can be chosen arbitrarily by
100   the client to be large enough to hold all desired symbols. A
101   special KeySym value of NoSymbol should be used to fill in
102   unused elements for individual KeyCodes. It is legal for
103   NoSymbol to appear in nontrailing positions of the effective
104   list for a KeyCode.XChangeDeviceKeyMapping generates a
105   DeviceMappingNotify event that is sent to all clients that have
106   selected that type of event.
107
108   There is no requirement that the X server interpret this
109   mapping. It is merely stored for reading and writing by
110   clients.
111
112   If the specified device does not support input class keys, a
113   BadMatch error results.
114
115   XChangeDeviceKeyMapping can generate a BadDevice, BadMatch,
116   BadAlloc, or BadValue error.
117
118DIAGNOSTICS
119-----------
120
121   BadDevice
122          An invalid device was specified. The specified device
123          does not exist or has not been opened by this client via
124          XOpenInputDevice. This error may also occur if the
125          specified device is the X keyboard or X pointer device.
126
127   BadMatch
128          This error may occur if an XGetDeviceKeyMapping or
129          XChangeDeviceKeyMapping request was made specifying a
130          device that has no keys.
131
132   BadValue
133          Some numeric value falls outside the range of values
134          accepted by the request. Unless a specific range is
135          specified for an argument, the full range defined by the
136          argument's type is accepted. Any argument defined as a
137          set of alternatives can generate this error.
138
139   BadAlloc
140          The server failed to allocate the requested resource or
141          server memory.
142
143SEE ALSO
144--------
145
146   XSetDeviceButtonMapping(libmansuffix), XSetDeviceModifierMapping(__libmansuffix_)
147