Handling the great diversity of keyboard devices and international language character encodings is a difficult problem for interactive programs that need to receive text input but must also be portable. The X Window System solves this problem by using different sets of encodings for device keys (keycodes) and for character symbols ( keysyms). Each X server maintains a keyboard mapping that associates keycodes and keysyms, and which can be returned or changed by client programs.
To handle text input, a CLX client program must follow these steps: