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