|
libxkbcommon 1.12.3
Library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
|
This page presents the differences between the XKB 1.0 specification implemented in current X servers and its implementation in libxkbcommon.
xkbcommon has removed support for some parts of the specification which introduced unnecessary complications. Many of these removals were in fact not implemented, or half-implemented at best, as well as being totally unused in the standard keyboard layout database, xkeyboard-config.
On the other hand, xkbcommon has notable additions that lift hard-coded limitation of the X11 Protocol.
| Feature | X11 | xkbcommon (v1 format) | xkbcommon (v2 format) |
|---|---|---|---|
| Wayland support | ❌️ No supportWayland support requires the XWayland compatibility layer. | ✅ Full supportlibxkbcommon is the reference implementation of the keyboard keymap handling (parsing/serializing, state) for Wayland. | |
| User configuration | ❌️ No supportLayout database path is hard-coded in xserver. xkbcomp enable path configuration, but setxkbmap support is incomplete. | ✅ Full supportMultiple layout database path can be used simultaneously, enabling user-space configuration. See User-configuration for further information. | |
| Keycode override with aliases | ❌️ No supportKeycodes have always priority over aliases. | ✅ Full support (since 1.12)Keycodes and aliases share the same namespace. | |
| Extended keycodes | ❌️ No supportLimited to 8-bit keycodes. | ✅ Full supportSupport all Linux keycodes using 32-bit keycodes. | |
| Extended key names | ❌️ No supportLimited to 4-character names. | ✅ Full supportSupport any key names of any length. | |
| Extended number of layouts | ❌️ No supportLimited to 4 layouts. | ❌️ No supportLimited to 4 layouts. | ✅ Full support (since 1.11)Enable up to 32 layouts when using XKB_KEYMAP_FORMAT_TEXT_V2. |
| Unified modifiers | ❌️ No supportClear separation between real (i.e. core) and virtual modifiers. | ✅ Full supportReal and virtual modifiers have been collapsed into the same namespace, with a “significant” flag that largely parallels the core/virtual split. Real modifiers are predefined modifiers with fixed encoding and considered merely as a X11 compatibility feature. | |
| Extended modifiers | ❌️ No supportLimited to up to 8 independent modifiers. | ✅ Full supportEnable up to 32 independent modifiers. | |
| Canonical virtual modifiers | ❌️ No supportVirtual modifiers can only mapped to real modifiers (8 bits). | ⚠️ Partial supportOnly if using explicit mapping: e.g. virtual_modifiers M = 0x100; if M has the modifier index 8. | ✅ Full supportVirtual modifiers that are not mapped either explicitly (using e.g. virtual_modifiers M = …) or implicitly (using modifier_map and virtualModifier) automatically use to their canonical mapping. |
| Multiple keysyms per level | ❌️ Parsing onlyIgnored: fallback to NoSymbol. | ✅ Full support
| |
| Multiple actions per level | ❌️ No supportParse error. | ⚠️ Parsing & handling, no serializationCurrently limited to 1 action for each action type “group” and “modifier”.
| ⚠️ Partial supportCurrently limited to 1 action for each action type “group” and “modifier”.
|
| Geometry | ✅ Full support | ⚠️ Parsing onlyRational:
| |
| Radio groups | ✅ Full support | ❌️ No supportUnused in xkeyboard-config layouts. | |
| Overlays | ✅ Full support | ❌️ No supportUnused in xkeyboard-config layouts. | |
| Key behaviors | ✅ Full support | ❌️ No supportUsed to implement radio groups and overlays, and to deal with things like keys that physically lock; Unused in xkeyboard-config layouts. | |
| Indicator behaviors | ✅ Full support | ⚠️ Partial supportE.g. LED-controls-key behavior (X11’s IM_LEDDrivesKB flag enabled) is not supported. The only supported LED behavior is key-controls-LED. Unused in xkeyboard-config layouts. | |
| Type | Action | X11 | xkbcommon (v1 format) | xkbcommon (v2 format) |
|---|---|---|---|---|
| Ineffectual | NoAction() | ✅ Full support | ✅ Full support | |
| VoidAction() | ❌️ No support | ⚠️ Parsing only (since 1.10) | ✅ Full support (since 1.11) | |
| Modifiers | SetModifiers() | ⚠️ Partial support
| ⚠️ Partial support
| ✅ Full support
|
| LatchModifiers() | ⚠️ Partial support
| ⚠️ Partial support
| ✅ Full support
| |
| LockModifiers() | ⚠️ Partial support
| ⚠️ Partial support
| ✅ Full support
| |
| Groups | SetGroup() | ✅ Full support | ✅ Full support | |
| LatchGroup() | ✅ Full support | ✅ Full support | ||
| LockGroup() | ⚠️ Partial support
| ⚠️ Partial support
| ✅ Full support
| |
| Legacy action | MovePointer() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | |
| PointerButton() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| LockPointerButton() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| SetPointerDefault() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| SetControls() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| LockControls() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| TerminateServer() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| SwitchScreen() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| Private() | ✅ Full support | ⚠️ Parsing and serializing only, no API support | ||
| Unsupported legacy action | RedirectKey() | ✅ Full support | ❌️ Parsing only | |
| ISOLock() | ✅ Full support | ❌️ Parsing only | ||
| DeviceButton() | ✅ Full support | ❌️ Parsing only | ||
| LockDeviceButton() | ✅ Full support | ❌️ Parsing only | ||
| DeviceValuator() | ✅ Full support | ❌️ Parsing only | ||
| MessageAction() | ✅ Full support | ❌️ Parsing only | ||
| Feature | X11 (xkbcomp) | xkbcommon (v1 format) | xkbcommon (v2 format) |
|---|---|---|---|
| Optional keymap components | ❌️ All components are mandatory | ✅ Full support (since 1.9)Keymap components are no longer mandatory, e.g. a keymap without a xkb_types section is legal. | |
| Strong type check | ❌️ Weak type check | ⚠️ Stronger type check (WIP)Floating-point numbers cannot be used where an integer is expected. | |
| replace merge mode in include statements | ❌️ No support | ✅ Full support (since 1.9)Supported using the prefix ^, in addition to the standard merge | and override + modes. | |
| Keysym as strings | ❌️ No support | ✅ Full support (since 1.9)Keysyms can be written as their corresponding string, e.g. udiaeresis can be written "ü". A string with multiple Unicode code points denotes a list of the corresponding keysyms. An empty string denotes the keysym NoSymbol. | |
| Unicode escape sequence | ❌️ No support | ||
| Extended GroupN constants | ❌️ No supportOnly Group1..Group8 are supported, although the resulting group must be in the range 1..4. | ❌️ No supportOnly Group1..Group4 are supported. Use XKB_KEYMAP_FORMAT_TEXT_V2 in order to support further groups. | ✅ Full support (since 1.11)The pattern Group<INDEX> can be used for any valid group index <INDEX>. |
| Extended LevelN constants | ❌️ No supportOnly Level1..Level8 are supported. | ✅ Full support (since 1.11)Since 1.11, the pattern Level<INDEX> can be used for any valid level index <INDEX>. Before 1.11, only Level1..Level8 were supported. | |
| Extended include | ❌️ No support | ✅ Full support (since 1.11)Enable absolute paths and %-expansion. See keymap-include-percent-expansion for further details. | |
| Include predefined maps | ✅ Full support | ❌️ No supportThe modern approach is to use RMLVO. | |
| Exponent syntax for floating-point numbers | ✅ Full support | ❌️ No support
| |
| alternate merge mode | ✅ Full support | ⚠️ Parsing, fallback to default merge modealternate was used in xkb_keycodes type sections and meant that if a new keycode name conflicts with an old one, consider it as a keycode alias. | |
| Multiple group definition in symbols section | ✅ Full support | ||
| Feature | X11 | xkbcommon (v1 format) | xkbcommon (v2 format) |
|---|---|---|---|
| Full Unicode support | ❌️ Incomplete | ✅ Full supportFull support of simple case mappings for xkb_keysym_to_lower() and xkb_keysym_to_upper(). | |
| KcCGST | ✅ Full support | ⚠️ Partial support (since 1.10)
| |
| XKM file format | ✅ Full support | ❌️ No supportObsolete legacy file format tied to X11 ecosystem. | |
| Feature | X11 | xkbcommon (v1 format) | xkbcommon (v2 format) |
|---|---|---|---|
| ! include statement | ❌️ No support | ✅ Full supportSee rules include statement for further details. | |
| replace merge mode | ❌️ No support | ✅ Full support (since 1.9)Support the merge mode replace via the prefix ^, in addition to the standard merge | and override + modes. | |
| Extended layout indices | ❌️ No support | ✅ Full support (since 1.8)
See extended layout indices for further details. | |
| :all qualifier | ❌️ No support | ✅ Full support (since 1.8)the :all qualifier: it applies the qualified item to all layouts. See :all qualifier for further details. | |
| Extended wild cards | ❌️ No support | ✅ Full support (since 1.9)
See rules wildcards for further information. | |
| Feature | X11 | xkbcommon |
|---|---|---|
| XML format | ❌️ No support | ✅ Full support
|
Relative to the standard implementation in libX11 (described in the Compose(5) man-page):
| Feature | X11 (libX11) | xkbcommon |
|---|---|---|
| [!] MODIFIER syntax | ✅ Full support | ⚠️ Parsing onlySyntax: [([!] ([~] MODIFIER)...) | None] <keysym> If the modifier list is preceded by ! it must match exactly. MODIFIER may be one of Ctrl, Lock, Caps, Shift, Alt or Meta. Each modifier may be preceded by a ~ character to indicate that the modifier must not be present. If None is specified, no modifier may be present.
|
| Modifier keysyms in sequences | ✅ Full support | ⚠️ Parsed, but key events are ignoredModifiers should not be used in Compose sequences. Use keymap’s features or a keysym with more appropriate semantics. |
| Interactions with Braille keysyms | ✅ Full support | ❌️ No support
|