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