Previous: , Up: Keyboard Encodings   [Contents][Index]


15.4.3 Using Keycodes and Keysyms

The following paragraphs describe the CLX functions used to:

Function: keycode->keysym display keycode keysym-index
display

A display.

keycode

A card8.

keysym-index

A card8.

Returns the keysym at the given keysym-index from the keysym list for the keycode in the current keyboard mapping for the display server. This function was called keycode-keysym in X11R4 and older versions of CLX.

keysym

Type keysym.

Function: keysym->character display keysym &optional (state 0)
display

A display.

keysym

A keysym.

state

A mask16.

Returns the character associated with the keysym and the state. The state is a mask16 bit mask representing the state of the display modifier keys and pointer buttons. See state-mask-key in Data Types. If the keysym does not represent a Common Lisp character, then nil is returned. This function was called keysym-character in X11R4 and older versions of CLX.

The state determines the bits attribute of the returned character, as follows:

:control

char-control-bit

:mod-1

char-meta-bit

:mod-2

char-super-bit

:mod-3

char-hyper-bit

character

Type character or null.

Function: character->keysyms character &optional display
character

A character.

display

A display.

Given a character, returns a list of all matching keysyms. If display is given, translations specific to display are used. Otherwise only global translations are used.

This function is implementation dependent.

Calling this function may be slow, because it involves a linear search over all known keysyms.


Previous: , Up: Keyboard Encodings   [Contents][Index]