To obtain a KeySym for the KeyCode of an event, use XLookupKeysym().
To obtain a KeySym for a specific KeyCode, use XKeycodeToKeysym().
To obtain a KeyCode for a key having a specific KeySym, use XKeysymToKeycode().
The mapping between KeyCodes and KeySyms is cached internal to Xlib. When this information is changed at the server, an Xlib function must be called to refresh the cache. To refresh the stored modifier and keymap information, use XRefreshKeyboardMapping().
To obtain the uppercase and lowercase forms of a KeySym, us XConvertCase().
KeySyms have string names as well as numeric codes. To convert the name of the KeySym to the KeySym code, use XStringToKeysym().
To convert a KeySym code to the name of the KeySym, use XKeysymToString().