1XGETDEVICEMODIFIERMA(3) XGETDEVICEMODIFIERMA(3)
2
3
4
6 XGetDeviceModifierMapping, XSetDeviceModifierMapping - query or change
7 device modifier mappings
8
10 #include <X11/extensions/XInput.h>
11
12 int XSetDeviceModifierMapping( Display *display,
13 XDevice *device,
14 XModifierKeymap *modmap);
15
16 XModifierKeymap *XGetDeviceModifierMapping( Display *display,
17 XDevice *device);
18
19 display
20 Specifies the connection to the X server.
21
22 device
23 Specifies the device whose modifier mapping is to be
24 queried or modified.
25
26 modmap
27 Specifies a pointer to the XModifierKeymap structure.
28
30 The XSetDeviceModifierMapping request specifies the KeyCodes of
31 the keys (if any) that are to be used as modifiers for the
32 specified device. If it succeeds, the X server generates a
33 DeviceMappingNotify event, and XSetDeviceModifierMapping
34 returns MappingSuccess. X permits at most eight modifier keys.
35 If more than eight are specified in the XModifierKeymap
36 structure, a BadLength error results.
37
38 The modifiermap member of the XModifierKeymap structure
39 contains eight sets of max_keypermod KeyCodes, one for each
40 modifier in the order Shift, Lock, Control, Mod1, Mod2, Mod3,
41 Mod4, and Mod5. Only nonzero KeyCodes have meaning in each set,
42 and zero KeyCodes are ignored. In addition, all of the nonzero
43 KeyCodes must be in the range specified by min_keycode and
44 max_keycode as returned by XListInputDevices, or a BadValue
45 error results. No KeyCode may appear twice in the entire map,
46 or a BadValue error results.
47
48 An X server can impose restrictions on how modifiers can be
49 changed, for example, if certain keys do not generate up
50 transitions in hardware, if auto-repeat cannot be disabled on
51 certain keys, or if multiple modifier keys are not supported.
52 If some such restriction is violated, the status reply is
53 MappingFailed, and none of the modifiers are changed. If the
54 new KeyCodes specified for a modifier differ from those
55 currently defined and any (current or new) keys for that
56 modifier are in the logically down state,
57 XSetDeviceModifierMapping returns MappingBusy, and none of the
58 modifiers is changed.
59
60 XSetDeviceModifierMapping can generate BadLength, BadDevice,
61 BadMatch, BadAlloc, and BadValue errors.
62
63 The XGetDeviceModifierMapping request returns a pointer to a
64 newly created XModifierKeymap structure that contains the keys
65 being used as modifiers. The structure should be freed after
66 use by calling XFreeModifierMapping . If only zero values
67 appear in the set for any modifier, that modifier is disabled.
68
69 XGetDeviceModifierMapping can generate BadDevice and BadMatch
70 errors.
71
72 Structures
73
74 The XModifierKeymap structure contains:
75
76 typedef struct {
77 int max_keypermod;
78 KeyCode *modifiermap;
79 } XModifierKeymap;
80
82 BadLength
83 More than eight keys were specified in the
84 XModifierKeymap structure.
85
86 BadAlloc
87 The server failed to allocate the requested resource or
88 server memory.
89
90 BadDevice
91 An invalid device was specified. The specified device
92 does not exist or has not been opened by this client via
93 XOpenInputDevice. This error may also occur if the
94 specified device is the X keyboard or X pointer device.
95
96 BadMatch
97 This error may occur if an XGetDeviceModifierMapping or
98 XChangeDeviceModifierMapping request was made specifying
99 a device that has no keys.
100
101 BadValue
102 Some numeric value falls outside the range of values
103 accepted by the request. Unless a specific range is
104 specified for an argument, the full range defined by the
105 argument's type is accepted. Any argument defined as a
106 set of alternatives can generate this error.
107
109 XSetDeviceKeyMapping(3), XSetDeviceButtonMapping(3)
110
111
112
113 09/15/2021 XGETDEVICEMODIFIERMA(3)