1 XGETDEVICEKEYMAPPING(libmansuffix)
2 ==================================
7 XGetDeviceKeyMapping, XChangeDeviceKeyMapping - query or change
13 #include <X11/extensions/XInput.h>
15 KeySym *XGetDeviceKeyMapping( Display *display,
17 KeyCode first_keycode,
19 int *keysyms_per_keycode_return);
21 Specifies the connection to the X server.
24 Specifies the device whose key mapping is to be queried
28 Specifies the first KeyCode to be returned.
31 Specifies the number of KeyCodes to be returned or
35 Specifies the number of KeySyms per KeyCode.
37 keysyms_per_keycode_return
38 Specifies the address of a variable into which the
39 number of KeySyms per KeyCodewill be returned.
42 Specifies the address of an array of KeySyms.
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:
55 first_keycode + keycode_count - 1
57 If this is not the case, a BadValue error results. The number
58 of elements in the KeySyms list is:
60 keycode_count * keysyms_per_keycode_return
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
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.
72 If the specified device does not support input class keys, a
73 BadMatch error will result.
75 XGetDeviceKeyMapping can generate a BadDevice, BadMatch, or
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
84 num_codes * keysyms_per_keycode
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:
92 first_keycode + num_codes - 1
94 KeySym number N, counting from zero, for KeyCode K has the
95 following index in keysyms, counting from zero:
97 (K - first_keycode) * keysyms_per_keycode + N
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.
108 There is no requirement that the X server interpret this
109 mapping. It is merely stored for reading and writing by
112 If the specified device does not support input class keys, a
113 BadMatch error results.
115 XChangeDeviceKeyMapping can generate a BadDevice, BadMatch,
116 BadAlloc, or BadValue error.
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.
128 This error may occur if an XGetDeviceKeyMapping or
129 XChangeDeviceKeyMapping request was made specifying a
130 device that has no keys.
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.
140 The server failed to allocate the requested resource or
146 XSetDeviceButtonMapping(libmansuffix), XSetDeviceModifierMapping(__libmansuffix_)