|
libxkbcommon 1.13.2
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) </thead> <tbody>
Wayland support
❌️ No support
Wayland support requires the XWayland compatibility layer.
✅ Full support
libxkbcommon is the reference implementation of the keyboard keymap handling (parsing/serializing, state) for Wayland.
User configuration
❌️ No support
Layout database path is hard-coded in xserver.
xkbcomp enables path configuration, but setxkbmap support is incomplete.
✅ Full support
Multiple layout database paths can be used simultaneously, enabling user-space configuration.
Configuration via third-party packages
❌️ No support
Layout database path is hard-coded in xserver.
xkbcomp enables path configuration, but setxkbmap support is incomplete.
✅ Full support (since 1.13)
Multiple layout database paths can be used simultaneously, enabling third-party packages to extend the base configuration without hacking its files.
Keycode override with aliases
❌️ No support
Keycodes have always priority over aliases.
✅ Full support (since 1.12)
Keycodes and aliases share the same namespace.
Extended keycodes
❌️ No support
Limited to 8-bit keycodes.
✅ Full support
Support all Linux keycodes using 32-bit keycodes.
Extended key names
❌️ No support
Limited to 4-character names.
✅ Full support
Support any key names of any length.
Extended number of layouts
❌️ No support
Limited to 4 layouts.
❌️ No support
Limited to 4 layouts.
✅ Full support (since 1.11)
Enable up to 32 layouts when using XKB_KEYMAP_FORMAT_TEXT_V2.
Unified modifiers
❌️ No support
Clear separation between real (i.e. core) and virtual modifiers.
✅ Full support
Real and virtual modifiers have been collapsed into the same namespace, with a “significant” flag that largely parallels the core/virtual split.
Extended modifiers
❌️ No support
Limited to up to 8 independent modifiers.
✅ Full support
Enable up to 32 independent modifiers.
Canonical virtual modifiers
❌️ No support
Virtual modifiers can only mapped to real modifiers (8 bits).
⚠️ Partial support
Only if using explicit mapping: e.g. virtual_modifiers M = 0x100; if M has the modifier index 8.
✅ Full support
Virtual 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 groups per key
✅ Full support
Contiguous identical groups are merged together.
Multiple keysyms per level
❌️ Parsing only
Ignored: fallback to NoSymbol.
✅ Full support
❌️ No support
Parse error.
⚠️ Parsing & handling, no serialization
Currently limited to 1 action for each action type “group” and “modifier”.
VoidAction() for compatibility with X11.
⚠️ Partial support
Currently limited to 1 action for each action type “group” and “modifier”.
⚠️ Parsing only
❌️ No support
Unused in xkeyboard-config layouts.
❌️ No support
Unused in xkeyboard-config layouts.
❌️ No support
Used to implement radio groups and overlays, and to deal with things like keys that physically lock;
⚠️ Partial support
IM_LEDDrivesKB flag enabled) is not supported.
NoAction()
VoidAction()
SetModifiers()
⚠️ Partial support
unlockOnPress parameter is not supported.
⚠️ Partial support
unlockOnPress parameter is not supported. Use XKB_KEYMAP_FORMAT_TEXT_V2.
✅ Full support
unlockOnPress parameter (since 1.11). See its documentation for further details.
LatchModifiers()
⚠️ Partial support
latchOnPress parameter is not supported.unLockOnPress parameter is not supported.
⚠️ Partial support
latchOnPress parameter is not supported. Use XKB_KEYMAP_FORMAT_TEXT_V2.unLockOnPress parameter is not supported. Use XKB_KEYMAP_FORMAT_TEXT_V2.
✅ Full support
latchOnPress parameter (since 1.11). See its documentation for further details.unLockOnPress parameter (since 1.11). See its documentation for further details.
LockModifiers()
⚠️ Partial support
unlockOnPress parameter is not supported.
⚠️ Partial support
unlockOnPress parameter is not supported. Use XKB_KEYMAP_FORMAT_TEXT_V2.
✅ Full support
unlockOnPress parameter (since 1.11). See its documentation for further details.
SetGroup()
LatchGroup()
LockGroup()
⚠️ Partial support
lockOnRelease parameter is not supported. Use XKB_KEYMAP_FORMAT_TEXT_V2.
⚠️ Partial support
lockOnRelease parameter is not supported. Use XKB_KEYMAP_FORMAT_TEXT_V2.
✅ Full support
lockOnRelease (since 1.11). See its documentation for further details.
MovePointer()
PointerButton()
LockPointerButton()
SetPointerDefault()
SetControls()
LockControls()
TerminateServer()
SwitchScreen()
Private()
RedirectKey()
ISOLock()
DeviceButton()
LockDeviceButton()
DeviceValuator()
MessageAction()
✅ Full support (since 1.9)
Keymap components are no longer mandatory, e.g. a keymap without a xkb_types section is legal.
⚠️ Stronger type check (WIP)
Floating-point numbers cannot be used where an integer is expected.
replace merge mode in include statements
✅ Full support (since 1.9)
Supported using the prefix ^, in addition to the standard merge | and override + modes.
✅ 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.
✅ Full support (since 1.9)
\u{NNNN}.
GroupN constants
❌️ No support
Only Group1..Group8 are supported, although the resulting group must be in the range 1..4.
❌️ No support
Only Group1..Group4 are supported.
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>.
LevelN constants
❌️ No support
Only 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>.
Level1..Level8 were supported.
✅ Full support (since 1.11)
Enable absolute paths and *%-expansion*.
❌️ No support
The modern approach is to use RMLVO.
❌️ No support
⚠️ Parsing, fallback to default merge mode
alternate 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.
✅ Full support
Full support of simple case mappings for xkb_keysym_to_lower() and xkb_keysym_to_upper().
⚠️ Partial support (since 1.10)
xkb_component_names::xkb_components_names_from_rules() for debugging purposes.
❌️ No support
Obsolete legacy file format tied to X11 ecosystem.
*.pre and *.post rules files
✅ Full support (since 1.13)
See RMLVO resolution process for further details.
! include statement
✅ Full support
See rules include statement for further details.
replace merge mode
✅ Full support (since 1.9)
Support the merge mode replace via the prefix ^, in addition to the standard merge | and override + modes.
✅ Full support (since 1.8)
layout[single] is the same as without explicit index: layout.layout and layout[1].layout[2] .. layout[MAX_LAYOUT], where MAX_LAYOUT is currently 4.:all qualifier: it applies the qualified item to all layouts.
:all qualifier
✅ Full support (since 1.8)
the :all qualifier: it applies the qualified item to all layouts.
✅ Full support (since 1.9)
<none> matches empty value;<some> matches non-empty value in every context.<any> matches optionally empty value in every context, contrary to the legacy * wild card which does not match empty values for layout and variant.
✅ Full support
rationale
</tbody>
libX11)
[!] MODIFIER syntax
⚠️ Parsing only
Syntax: [([!] ([~] MODIFIER)...) | None] <keysym>
! 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.
⚠️ Parsed, but key events are ignored
Modifiers should not be used in Compose sequences. Use keymap’s features or a keysym with more appropriate semantics.
❌️ No support
feature description, removal rationale
</tbody>