libxkbcommon 1.14.0-beta1
Library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
Loading...
Searching...
No Matches
Keysym encoding
Collaboration diagram for Keysym encoding:

Description of the keysyms encoding and the categories of keysyms.

See also
Appendix A “Keysym Encoding” of the X Window System Protocol.
Appendix C “New keysyms” of the XKB Protocol Specification.

Encoding

Important
Keysyms are 32-bit integers whoose 3 most significant bits are always set to zero. Thus valid keysyms are in the range 0 – 0x1fffffff = XKB_KEYSYM_MAX.
Note
Throughout this documentation, keysyms values are viewed as four bytes, numbered from most significant to least significant:
Byte 1
The most significant 8 bits: 3 zero bits and the most-significant 5 bits of the 29-bit effective value.
Byte 2
The next most-significant 8 bits
Byte 3
The next most-significant 8 bits
Byte 4
The least-significant 8 bits

Categories

There are 6 categories:

Overview

CategorySubcategoryByte 1Byte 2Byte 3Byte 4First keysymLast keysym
Special keysyms0000NoSymbol
Latin-1 keysymsASCII non-control characters0000x20 – 0x7espaceasciitilde
Latin-1 Supplement0xa0 – 0xffnobreakspaceydiaeresis
Legacy keysymsLatin-2000x010x00 – 0xffAogonekabovedot
Latin-30x02Hstrokescircumflex
Latin-40x03kraumacron
Kana0x04overlinesemivoicedsound
Arabic0x05Arabic_commaArabic_sukun
Cyrillic0x06Serbian_djeCyrillic_HARDSIGN
Greek0x07Greek_ALPHAaccentGreek_omega
Technical0x08leftradicaldownarrow
Special0x09blankvertbar
Publishing0x0aemspacecursor
APL0x0bleftcaretrighttack
Hebrew0x0chebrew_doublelowlinehebrew_taf
Thai0x0dThai_kokaiThai_lekkao
Korean0x0eHangul_KiyeogKorean_Won
Latin-50x0f
Latin-60x10
Latin-70x11
Latin-80x12
Latin-90x13OEYdiaeresis
Currency0x20EuroSign
Function keysymsIBM 3270 terminals000xfd0x00 – 0xff3270_Duplicate3270_Enter
Keyboard (XKB) Extension0xfeISO_LockPointer_Drag5
Keyboard0xffBackSpaceDelete
Special keysyms00xff0xff0xffVoidSymbol
Unicode keysyms0x010x00 – 0x100x00 – 0xff0x00 – 0xff0x010001000x0110ffff
Vendor keysymsDEC, HP, misc.0x100x000x00 – 0xff0x00 – 0xff0x100000000x1000ffff
0x100x01 – 0x030x100100000x1003ffff
OSF0x100x040x100400000x1004ffff
Sun0x100x050x100500000x1005ffff
0x100x06 – 0x070x100600000x1007ffff
XFree860x100x080x100800000x1008ffff
0x10 – 0x1f0x09 – 0xff0x100900000x1fffffff

Special keysyms

There are 2 special values: NoSymbol and VoidSymbol. They are used to indicate the absence of symbols.

Byte 1 Byte 2 Byte 3 Byte 4 Hex. value Name
0 0 0 0 0x00000000 NoSymbol
0 255 255 255 0x00ffffff VoidSymbol
See also
Appendix A “Special keysyms” of the X Window System Protocol.

Latin-1 keysyms

The Latin-1 keysyms occupy the range 0x0020 – 0x007E and 0x00a0 – 0x00ff and represent the ISO 10646 / Unicode characters U+0020 – U+007E and U+00A0 – U+00FF, respectively.

See also
ISO/IEC 8859-1 character encoding
Appendix A “Latin-1 keysyms” of the X Window System Protocol.

Legacy keysyms

Legacy keysyms date from the time before ISO 10646 / Unicode was available. They represent characters from a number of different older 8-bit coded character sets and have zero values for bytes 1 and 2. Byte 3 indicates a coded character set and byte 4 is the 8-bit value of the particular character within that set.

Byte 3
ValueCharacter setComment
1Latin-2
2Latin-3
3Latin-4
4Kana
5Arabic
6Cyrillic
7Greek
8TechnicalBased on DEC Technical‌: add 0x880 to the original code point
9SpecialBased on DEC Special Graphics‌: add 0x980 to the original code point
10Publishing
11APL
12Hebrew
13Thai
14Korean
15Latin-5
16Latin-6
17Latin-7
18Latin-8
19Latin-9
32Currency

Each character set contains gaps where codes have been removed that were duplicates with codes in previous character sets (that is, character sets with lesser byte 3 value).

Todo
Legacy keysyms
See also
Latin-1 keysyms
Appendix A “Legacy keysyms” of the X Window System Protocol.

Function keysyms

Function keysyms represent keycap symbols that do not directly represent elements of a coded character set. Instead, they typically identify a software function, mode, or operation (e.g., cursor up, caps lock, insert) that can be activated using a dedicated key. Function keysyms have zero values for bytes 1 and 2. Byte 3 distinguishes between several 8-bit sets within which byte 4 identifies the individual function key.

Byte 1Byte 2Byte 3Byte 4
ValueValueValueFunction setValue
00253IBM 3270 terminals(individual function key)
254Keyboard (XKB) Extension
255Keyboard
Todo
Function keysyms
See also
Appendix A “Function keysyms” of the X Window System Protocol.
Appendix C “New keysyms” of the XKB Protocol Specification.

Unicode keysyms

The Unicode keysyms occupy the range 0x01000100 – 0x0110FFFF and represent the ISO 10646 / Unicode characters U+0100 – U+10FFFF, respectively. The numeric value of a Unicode keysym is the Unicode code point of the corresponding character plus 0x01000000. In the interest of backwards compatibility, clients should be able to process both the Unicode keysym and the legacy keysym for those characters where both exist.

Note
Dead keys, which place an accent on the next character entered, shall be encoded as function keysyms, and not as the Unicode keysym corresponding to an equivalent combining character.
Where a keycap indicates a specific function with a graphical symbol that is also available in Unicode (e.g., an upwards arrow for the cursor up function), the appropriate function keysym should be used, and not the Unicode keysym corresponding to the depicted symbol.
See also
Appendix A “Unicode keysyms” of the X Window System Protocol.
Unicode technical website.

Vendor keysyms

Vendor keysyms are vendor-specific extentions in the range 0x10000000 – 0x1fffffff. Among these, the range 0x11000000 – 0x1100ffff is designated for keypad keysyms.

See also
Appendix A “Vendor keysyms” of the X Window System Protocol.