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