xgetmodifiermapping(3x) [hpux man page]
XGetModifierMapping() XGetModifierMapping() Name XGetModifierMapping - obtain the mapping of modifier keys (Shift, Control, etc.). Synopsis XModifierKeymap *XGetModifierMapping(display) Display *display; Arguments display Specifies a connection to an X server; returned from XOpenDisplay(). Returns The current modifier mapping. Description XGetModifierMapping() returns the keycodes of the keys being used as modifiers. There are eight modifiers, represented by the symbols ShiftMapIndex, LockMapIndex, ControlMapIndex, Mod1MapIndex, Mod2MapIndex, Mod3Map- Index, Mod4MapIndex, and Mod5MapIndex. The modifiermap member of the XModifierKeymap() structure contains eight sets of keycodes, each set containing max_keypermod keycodes. Zero keycodes are not meaningful. If an entire modifiermap is filled with zero's, the corresponding modifier is disabled. No keycode will appear twice anywhere in the map. Structures typedef struct { int max_keypermod; /* server's max number of keys per modifier */ KeyCode *modifiermap; /* an 8 by max_keypermod array of * keycodes to be used as modifiers */ } XModifierKeymap; /* modifier names. Used to build a SetModifierMapping request or to read a GetModifierMapping request. */ #define ShiftMapIndex 0 #define LockMapIndex 1 #define ControlMapIndex 2 #define Mod1MapIndex 3 #define Mod2MapIndex 4 #define Mod3MapIndex 5 #define Mod4MapIndex 6 #define Mod5MapIndex 7 See Also XChangeKeyboardMapping(), XDeleteModifiermapEntry(), XFreeModifiermap(), XGetKeyboardMapping(), XInsertModifiermapEntry(), XKey- codeToKeysym(), XKeysymToKeycode(), XKeysymToString(), XLookupKeysym(), XLookupString(), XNewModifierMap, XQueryKeymap(), XRebindKeySym, XRefreshKeyboardMapping(), XSetModifierMapping(), XStringToKeysym(). X Programming Library XGetModifierMapping()
Check Out this Related Man Page
XLookupKeysym() XLookupKeysym() Name XLookupKeysym - get the keysym corresponding to a keycode in structure. Synopsis KeySym XLookupKeysym(event, index) XKeyEvent *event; int index; Arguments event Specifies the KeyPress or KeyRelease event that is to be used. index Specifies which keysym from the list associated with the keycode in the event to return. These correspond to the modifier keys, and the symbols ShiftMapIndex, LockMapIndex, ControlMapIndex, Mod1MapIndex, Mod2MapIndex, Mod3MapIndex, Mod4MapIndex, and Mod5Map- Index can be used. Returns The keysym. Description Given a keyboard event and the index into the list of keysyms for that keycode, XLookupKeysym() returns the keysym from the list that cor- responds to the keycode in the event. If no keysym is defined for the keycode of the event, XLookupKeysym() returns NoSymbol. Each keycode may have a list of associated keysyms, which are portable symbols representing the meanings of the key. The index specifies which keysym in the list is desired, indicating the combination of modifier keys that are currently pressed. Therefore, the program must interpret the state member of the XKeyEvent structure to determine the index before calling this function. The exact mapping of modifier keys into the list of keysyms for each keycode is server-dependent beyond the fact that the first keysym corresponds to the keycode without modifier keys, and the second corresponds to the keycode with Shift pressed. XLookupKeysym() simply calls XKeycodeToKeysym(), using arguments taken from the specified event structure. Structures typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* display the event was read from */ Window window; /* "event" window it is reported relative to */ Window root; /* root window that the event occured on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ unsigned int keycode; /* detail */ Bool same_screen; /* same screen flag */ } XKeyEvent; See Also XChangeKeyboardMapping(), XDeleteModifiermapEntry(), XFreeModifiermap(), XGetKeyboardMapping(), XGetModifierMapping(), XInsertModi- fiermapEntry(), XKeycodeToKeysym(), XKeysymToKeycode(), XKeysymToString(), XLookupString(), XNewModifiermap(), XQueryKeymap(), XRebind- Keysym(), XRefreshKeyboardMapping(), XSetModifierMapping(), XStringToKeysym(). Xlib - Keyboard XLookupKeysym()