XGetKeyboardMapping()XGetKeyboardMapping()Name
XGetKeyboardMapping – return symbols for keycodes.
Synopsis
KeySym *XGetKeyboardMapping(display, first_keycode, keycode_count,
keysyms_per_keycode_return)
Display *display;
KeyCode first_keycode;
int keycode_count;
int *keysyms_per_keycode_return;
Arguments
display Specifies a connection to an X server; returned from XOpenDis‐
play().
first_keycode
Specifies the first keycode that is to be returned.
keycode_count
Specifies the number of keycodes that are to be returned.
keysyms_per_keycode_return
Returns the number of keysyms per keycode.
Returns
The list of KeySyms.
Description
Starting with first_keycode, XGetKeyboardMapping() returns the symbols
for the specified number of keycodes. The specified first_keycode must
be greater than or equal to min_keycode as returned by XDisplayKey‐
codes(), otherwise a BadValue error occurs. In addition, the following
expression must be less than or equal to max_keycode (also returned by
XDisplayKeycodes()) as returned in the Display structure, otherwise a
BadValue error occurs:
first_keycode + keycode_count - 1
The number of elements in the keysyms list is:
keycode_count * keysyms_per_keycode_return
Then, keysym number N (counting from 0) for keycode K has an index
(counting from 0) of the following (in keysyms):
(K - first_keycode) * keysyms_per_keycode_return + N
The keysyms_per_keycode_return value is chosen arbitrarily by the
server to be large enough to report all requested symbols. A special
KeySym value of NoSymbol is used to fill in unused elements for indi‐
vidual keycodes.
Use XFree() to free the returned keysym list when you no longer need
it.
For more information, see Volume One, Chapter 9, The Keyboard and
Pointer.
Errors
BadValue first_keycode less than display->min_keycode.
display->max_keycode exceeded.
See AlsoXChangeKeyboardMapping(), XDeleteModifiermapEntry(), XFreeModi‐
fiermap(), XGetModifierMapping(), XInsertModifiermapEntry(), XKey‐
codeToKeysym(), XKeysymToKeycode(), XKeysymToString(), XLookupKeysym(),
XLookupString(), XNewModifierMap, XQueryKeymap(), XRebindKeySym, XRe‐
freshKeyboardMapping(), XSetModifierMapping(), XStringToKeysym().
Xlib - Keyboard XGetKeyboardMapping()