|
libxkbcommon 1.13.0
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.
| ✅ Full supportMultiple layout database paths can be used simultaneously, enabling user-space configuration. See User-configuration for further information. | ||||
| Configuration via third-party packages | ❌️ No supportLayout database path is hard-coded in xserver.
| ✅ 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. See Packaging keyboard layouts 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. | ⚠️ Serializing requires renaming
| ✅ Full supportSupport any key and aliases 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 | |||
| 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. | ✅ Full supportVirtual modifiers that are not mapped either explicitly (using e.g. | |||
| Multiple groups per key | ✅ Full supportContiguous identical groups are merged together. | ⚠️ Not supported in the @ref RMLVO-intro "RMLVO" APISince version 1.8 the RMLVO API does not support parsing multiple groups per key anymore, because it may break the expectation of most desktop environments and tools that the number of groups should be equal to the number of configured layouts. See How do I define multiple groups per key? for migration instructions. | ||||
| Multiple keysyms per level | ❌️ Parsing onlyIgnored: fallback to | ✅ Full support
❌️ Parsing only
| ⚠️ 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”.
| ||
| Keyboard controls | ✅ Full supportOnly overlay controls `1` and `2` are supported, consistent with the keyboard overlay support. | ⚠️ Partial support (since 1.14)Only overlay controls `1` and `2` are supported, consistent with the keyboard overlay support. | ⚠️ Partial support (since 1.14)See the supported keyboard controls in | |||
| Key behaviors | Overlays | ⚠️ Partial support
| ⚠️ Partial support (since 1.14)
| ✅ Full support (since 1.14)
| ||
| Radio groups | ✅ Full support | ❌️ Parsing onlyUnused in xkeyboard-config layouts. | ||||
| Lock | ✅ Full support | ❌️ Parsing onlyUnused in xkeyboard-config layouts. | ||||
| Indicator behaviors | ✅ Full support | ⚠️ Partial supportE.g. LED-controls-key behavior (X11’s The only supported LED behavior is key-controls-LED. Unused in xkeyboard-config layouts. | ||||
| Geometry | ✅ Full support | ❌️ Parsing onlyRational:
| ||||
| 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
| |
| Keyboard controls | SetControls() | ✅ Full support | ⚠️ Partial support
| |
LockControls() | ✅ Full support | ⚠️ Partial support
| ||
| Keyboard emulation | RedirectKey() | ✅ Full supportNote that the | ✅ Full support (since 1.14)
| |
| 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 | ||
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 | 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 | |
| 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 | |
| Keysym as strings | ❌️ No support | ✅ Full support (since 1.9)Keysyms can be written as their corresponding string, e.g. | |
| Unicode escape sequence | ❌️ No support | ||
First/Last group indices and masks constants | ❌️ No support | ✅ Full support (since 1.14)Enable to define e.g. a proper interpretation entry of the keysym interpret ISO_Last_Group {
action= LockGroup(group=last);
};
Note that contrary to These constants are parsed but never used for serialization, in order to maintain compatibility with xkbcomp and older libxkbcommon versions. | |
Extended GroupN constants | ❌️ No supportOnly | ❌️ No supportOnly Use | ✅ Full support (since 1.11)The pattern |
Extended LevelN constants | ❌️ No supportOnly | ✅ Full support (since 1.11)Since 1.11, the pattern Before 1.11, only | |
| Extended include | ❌️ No support | ✅ Full support (since 1.11)Enable absolute paths and * 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
⚠️ Parsing, fallback to default merge mode
| |
| 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 | |
| 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) |
|---|---|---|---|
Partial *.pre and *.post rules files | ❌️ No support | ✅ Full support (since 1.13)See RMLVO resolution process for further details. | |
! 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 | |
| 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 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: If the modifier list is preceded by
⚠️ 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
|