Hash :
b21a58d0
Author :
Date :
2025-07-01T14:52:11
Add support for all level indices to LevelN constants Note that serialization must use numbers instead of names for levels > 8, to ensure backward compatibility.
@tableofcontents{html:2}
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.
@todo This page is work in progress. It aims to be exhaustive. Please report any issue.
| 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 @ref user-configuration "" for further information. | |
| 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](@ref auto-modifier-encoding) use to their [canonical mapping](@ref canonical-modifier-def). |
| Multiple keysyms per level | ❌️ Parsing onlyIgnored: fallback to `NoSymbol`. | ✅ Full support@todo rationale | |
| Multiple actions per level | ❌️ No supportParse error. | ⚠️ Parsing & handling, no serializationCurrently limited to 1 action for each action type “group” and “modifier”. @since 1.8: Enable multiple actions per level (parsing, serializing & handling). @since 1.11: Serialize to `VoidAction()` for compatibility with X11. | ⚠️ Partial supportCurrently limited to 1 action for each action type “group” and “modifier”. @since 1.11 |
| Geometry @anchor geometry-support | ✅ Full support | ⚠️ Parsing onlyRational: - There were very few geometry definitions available in [xkeyboard-config], and while xkbcommon was responsible for parsing this insanely complex format, it never actually did anything with it. - Hopefully someone will develop a companion library which supports keyboard geometries in a more useful format, e.g. SVG. | |
| Radio groups | ❌️ 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- `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 @ref set-mods-action "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 @ref latch-mods-action "its documentation" for further details. - `unLockOnPress` parameter (since 1.11). See @ref latch-mods-action "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 @ref lock-mods-action "its documentation" for further details. | |
| Groups | `SetGroup()` | ✅ Full support | ✅ Full support | |
| `LatchGroup()` | ✅ Full support | ✅ Full support | ||
| `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 @ref lock-group-action "its documentation" for further details. | |
| 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 | ✅ Full support (since 1.9)`\u{NNNN}`. See @ref keymap-string-literal "string literal" for further information. | |
| 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 |
| Extended `LevelN` constants | ❌️ No supportOnly `Level1`..`Level8` are supported. | ✅ Full support (since 1.11)Since 1.11, the pattern `Level | |
| Extended include | ❌️ No support | ✅ Full support (since 1.11)Enable *absolute* paths and *`%`-expansion*. See @ref 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@todo syntax description | |
| `alternate` merge mode | ✅ Full 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*. | |
| Multiple group definition in symbols section | ✅ Full support | ⚠️ Supported, except in the [RMLVO] APISince 1.8, only 1 group per symbol section is supported in the [RMLVO] API, to avoid unintuitive results. Multiple groups per symbol section is supported when parsing a [KcCGST] keymap. | |
| 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] @anchor KcCGST-support | ✅ Full support | ⚠️ Partial support (since 1.10)- [KcCGST] is considered an implementation detail, use [RMLVO] instead. - Use `xkb_component_names::xkb_components_names_from_rules()` for debugging purposes. | |
| XKM file format | ✅ Full support | ❌️ No supportObsolete legacy file format tied to X11 ecosystem. | |
[KcCGST]: @ref KcCGST-intro [RMLVO]: @ref RMLVO-intro
| Feature | X11 | xkbcommon (v1 format) | xkbcommon (v2 format) |
|---|---|---|---|
| `! include` statement | ❌️ No support | ✅ Full supportSee @ref rules-include-expansion "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)- *single*: matches a single layout; `layout[single]` is the same as without explicit index: `layout`. - *first*: matches the first layout/variant, no matter how many layouts are in the RMLVO configuration. Acts as both `layout` and `layout[1]`. - *later*: matches all but the first layout. This is an index range. Acts as `layout[2]` .. `layout[MAX_LAYOUT]`, where `MAX_LAYOUT` is currently 4. - *any*: matches layout at any position. This is an index range. - the `:all` qualifier: it applies the qualified item to all layouts. See @ref rules-extended-layout-indices "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 @ref rules-all-qualifier ":all qualifier" for further details. | |
| Extended wild cards | ❌️ No support | ✅ Full support (since 1.9)- ` | |
| Feature | X11 | xkbcommon |
|---|---|---|
| XML format | ❌️ No support | ✅ Full support@todo rationale |
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] |
| 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@todo feature description, removal rationale |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922
# XKB Compatibility {#xkbcommon-compatibility}
@tableofcontents{html:2}
This page presents the differences between the [XKB 1.0 specification][XKB Protocol]
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].
@todo This page is work in progress. It aims to be exhaustive.
Please [report any issue](https://github.com/xkbcommon/libxkbcommon/issues).
[X11 Protocol]: https://www.x.org/releases/current/doc/xproto/x11protocol.html#Keyboards
[XKB Protocol]: https://www.x.org/releases/current/doc/kbproto/xkbproto.html
[xkeyboard-config]: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config
## Keymap support {#keymap-support}
### General features
<table>
<caption>Keymap features compatibility table</caption>
<thead>
<tr>
<th>Feature</th>
<th>X11</th>
<th>xkbcommon (v1 format)</th>
<th>xkbcommon (v2 format)</th>
</tr>
</thead>
<tbody>
<!-- Additions -->
<tr>
<th>Wayland support</th>
<td>
<details>
<summary>❌️ No support</summary>
Wayland support requires the XWayland compatibility layer.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
libxkbcommon is the *reference* implementation of the keyboard keymap handling
(parsing/serializing, state) for Wayland.
</details>
</td>
</tr>
<tr>
<th>User configuration</th>
<td>
<details>
<summary>❌️ No support</summary>
Layout database path is *hard-coded* in xserver.
`xkbcomp` enable path configuration, but `setxkbmap` support is incomplete.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
Multiple layout database path can be used simultaneously, enabling user-space
configuration.
See @ref user-configuration "" for further information.
</details>
</td>
</tr>
<tr>
<th>Extended keycodes</th>
<td>
<details>
<summary>❌️ No support</summary>
Limited to **8**-bit keycodes.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
Support all Linux keycodes using **32**-bit keycodes.
</details>
</td>
</tr>
<tr>
<th>Extended key names</th>
<td>
<details>
<summary>❌️ No support</summary>
Limited to **4**-character names.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
Support any key names of any length.
</details>
</td>
</tr>
<tr>
<th>Extended number of layouts</th>
<td>
<details>
<summary>❌️ No support</summary>
Limited to **4** layouts.
</details>
</td>
<td>
<details>
<summary>❌️ No support</summary>
Limited to **4** layouts.
</details>
</td>
<td>
<details>
<summary>✅ Full support (since 1.11)</summary>
Enable up to **32** layouts when using `::XKB_KEYMAP_FORMAT_TEXT_V2`.
</details>
</td>
</tr>
<tr>
<th>Unified modifiers</th>
<td>
<details>
<summary>❌️ No support</summary>
Clear separation between *real* (i.e. core) and *virtual* modifiers.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
Real 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.
</details>
</td>
</tr>
<tr>
<th>Extended modifiers</th>
<td>
<details>
<summary>❌️ No support</summary>
Limited to up to **8** *independent* modifiers.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
Enable up to **32** *independent* modifiers.
</details>
</td>
</tr>
<tr>
<th>Canonical virtual modifiers</th>
<td>
<details>
<summary>❌️ No support</summary>
Virtual modifiers can only mapped to *real* modifiers (8 bits).
</details>
</td>
<td>
<details>
<summary>⚠️ Partial support</summary>
Only if using explicit mapping: e.g. `virtual_modifiers M = 0x100;` if `M` has
the modifier index 8.
</details>
</td>
<td>
<details>
<summary>✅ Full support</summary>
Virtual modifiers that are not mapped either *explicitly* (using e.g.
`virtual_modifiers M = …`) or *implicitly* (using `modifier_map` and
`virtualModifier`) [automatically](@ref auto-modifier-encoding) use to
their <em>[canonical mapping](@ref canonical-modifier-def)</em>.
</details>
</td>
</tr>
<tr>
<th>Multiple keysyms per level</th>
<td>
<details>
<summary>❌️ Parsing only</summary>
Ignored: fallback to `NoSymbol`.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
@todo rationale
</details>
</td>
</tr>
<tr>
<th>Multiple actions per level</th>
<td>
<details>
<summary>❌️ No support</summary>
Parse error.
</details>
</td>
<td>
<details>
<summary>⚠️ Parsing & handling, no serialization</summary>
Currently limited to 1 action for each action type “group” and “modifier”.
@since 1.8: Enable multiple actions per level (parsing, serializing & handling).
@since 1.11: Serialize to `VoidAction()` for compatibility with X11.
</details>
</td>
<td>
<details>
<summary>⚠️ Partial support</summary>
Currently limited to 1 action for each action type “group” and “modifier”.
@since 1.11
</details>
</td>
</tr>
<!-- Removals -->
<tr>
<th>Geometry @anchor geometry-support</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>⚠️ Parsing only</summary>
Rational:
- There were very few geometry definitions available in [xkeyboard-config], and
while xkbcommon was responsible for parsing this insanely complex format,
it never actually did anything with it.
- Hopefully someone will develop a companion library which supports keyboard
geometries in a more useful format, e.g. SVG.
</details>
</td>
</tr>
<tr>
<th>Radio groups</th>
<td>✅ Full support</td><!-- exact status? -->
<td colspan="2">
<details>
<summary>❌️ No support</summary>
Unused in [xkeyboard-config] layouts.
</details>
</td>
</tr>
<tr>
<th>Overlays</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>❌️ No support</summary>
Unused in [xkeyboard-config] layouts.
</details>
</td>
</tr>
<tr>
<th>[Key behaviors]</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>❌️ No support</summary>
Used to implement radio groups and overlays, and to deal with things
like keys that physically lock;
Unused in [xkeyboard-config] layouts.
</details>
</td>
</tr>
<tr>
<th>[Indicator behaviors]</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>⚠️ Partial support</summary>
<!-- See commit 6e676cb7 -->
E.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.
</details>
</td>
</tr>
</tbody>
</table>
[Key behaviors]: https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Key_Behavior
[Indicator behaviors]: https://www.x.org/releases/current/doc/kbproto/xkbproto.html#:~:text=IM_LEDDrivesKB
### Key actions {#compatibility-key-actions}
<table>
<caption>Key actions compatibility table</caption>
<thead>
<tr>
<th>Type</th>
<th>Action</th>
<th>X11</th>
<th>xkbcommon (v1 format)</th>
<th>xkbcommon (v2 format)</th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="2">Ineffectual</th>
<th>`NoAction()`</th>
<td>✅ Full support</td>
<td colspan="2">✅ Full support</td>
</tr>
<tr>
<th>`VoidAction()`</th>
<td>❌️ No support</td>
<td>⚠️ Parsing only (since 1.10)</td>
<td>✅ Full support (since 1.11)</td>
</tr>
<tr>
<th rowspan="3">Modifiers</th>
<th>`SetModifiers()`</th>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `unlockOnPress` parameter is not supported.
</details>
</td>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `unlockOnPress` parameter is not supported. Use `::XKB_KEYMAP_FORMAT_TEXT_V2`.
</details>
</td>
<td>
<details>
<summary>✅ Full support</summary>
- `unlockOnPress` parameter (since 1.11). See @ref set-mods-action "its documentation"
for further details.
</details>
</td>
</tr>
<tr>
<th>`LatchModifiers()`</th>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `latchOnPress` parameter is not supported.
- `unLockOnPress` parameter is not supported.
</details>
</td>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `latchOnPress` parameter is not supported. Use `::XKB_KEYMAP_FORMAT_TEXT_V2`.
- `unLockOnPress` parameter is not supported. Use `::XKB_KEYMAP_FORMAT_TEXT_V2`.
</details>
</td>
<td>
<details>
<summary>✅ Full support</summary>
- `latchOnPress` parameter (since 1.11). See @ref latch-mods-action "its documentation"
for further details.
- `unLockOnPress` parameter (since 1.11). See @ref latch-mods-action "its documentation"
for further details.
</details>
</td>
</tr>
<tr>
<th>`LockModifiers()`</th>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `unlockOnPress` parameter is not supported.
</details>
</td>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `unlockOnPress` parameter is not supported. Use `::XKB_KEYMAP_FORMAT_TEXT_V2`.
</details>
</td>
<td>
<details>
<summary>✅ Full support</summary>
- `unlockOnPress` parameter (since 1.11). See @ref lock-mods-action "its documentation"
for further details.
</details>
</td>
</tr>
<tr>
<th rowspan="3">Groups</th>
<th>`SetGroup()`</th>
<td>✅ Full support</td>
<td colspan="2">✅ Full support</td>
</tr>
<tr>
<th>`LatchGroup()`</th>
<td>✅ Full support</td>
<td colspan="2">✅ Full support</td>
</tr>
<tr>
<th>`LockGroup()`</th>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `lockOnRelease` parameter is not supported. Use `::XKB_KEYMAP_FORMAT_TEXT_V2`.
</details>
</td>
<td>
<details>
<summary>⚠️ Partial support</summary>
- `lockOnRelease` parameter is not supported. Use `::XKB_KEYMAP_FORMAT_TEXT_V2`.
</details>
</td>
<td>
<details>
<summary>✅ Full support</summary>
- `lockOnRelease` (since 1.11). See @ref lock-group-action "its documentation"
for further details.
</details>
</td>
</tr>
<tr>
<th rowspan="9">Legacy action</th>
<th>`MovePointer()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`PointerButton()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`LockPointerButton()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`SetPointerDefault()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`SetControls()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`LockControls()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`TerminateServer()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`SwitchScreen()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th>`Private()`</th>
<td>✅ Full support</td>
<td colspan="2">⚠️ Parsing and serializing only, no API support</td>
</tr>
<tr>
<th rowspan="6">Unsupported legacy action</th>
<th>`RedirectKey()`</th>
<td>✅ Full support</td>
<td colspan="2">❌️ Parsing only</td>
</tr>
<tr>
<th>`ISOLock()`</th>
<td>✅ Full support</td>
<td colspan="2">❌️ Parsing only</td>
</tr>
<tr>
<th>`DeviceButton()`</th>
<td>✅ Full support</td>
<td colspan="2">❌️ Parsing only</td>
</tr>
<tr>
<th>`LockDeviceButton()`</th>
<td>✅ Full support</td>
<td colspan="2">❌️ Parsing only</td>
</tr>
<tr>
<th>`DeviceValuator()`</th>
<td>✅ Full support</td>
<td colspan="2">❌️ Parsing only</td>
</tr>
<tr>
<th>`MessageAction()`</th>
<td>✅ Full support</td>
<td colspan="2">❌️ Parsing only</td>
</tr>
</tbody>
</table>
### Keymap text format
<table>
<caption>Keymap text format compatibility table</caption>
<thead>
<tr>
<th>Feature</th>
<th>X11 (xkbcomp)</th>
<th>xkbcommon (v1 format)</th>
<th>xkbcommon (v2 format)</th>
</tr>
</thead>
<tbody>
<!-- Additions -->
<tr>
<th>Optional keymap components</th>
<td>❌️ All components are mandatory</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.9)</summary>
Keymap components are no longer mandatory, e.g. a keymap without a
`xkb_types` section is legal.
</details>
</td>
</tr>
<tr>
<th>Strong type check</th>
<td>❌️ Weak type check</td>
<td colspan="2">
<details>
<summary>⚠️ Stronger type check (WIP)</summary>
Floating-point numbers cannot be used where an integer is expected.
</details>
</td>
</tr>
<tr>
<th>`replace` merge mode in include statements</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.9)</summary>
Supported using the prefix `^`, in addition to the standard *merge* `|` and
*override* `+` modes.
</details>
</td>
</tr>
<tr>
<th>Keysym as strings</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.9)</summary>
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`.
</details>
</td>
</tr>
<tr>
<th>Unicode escape sequence</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.9)</summary>
`\u{NNNN}`.
See @ref keymap-string-literal "string literal" for further information.
</details>
</td>
</tr>
<tr>
<th>Extended `GroupN` constants</th>
<td>
<details>
<summary>❌️ No support</summary>
Only `Group1`..`Group8` are supported, although the resulting group must be in
the range 1..4.
</details>
</td>
<td>
<details>
<summary>❌️ No support</summary>
Only `Group1`..`Group4` are supported.
Use `::XKB_KEYMAP_FORMAT_TEXT_V2` in order to support further groups.
</details>
</td>
<td>
<details>
<summary>✅ Full support (since 1.11)</summary>
The pattern `Group<INDEX>` can be used for any valid group index `<INDEX>`.
</details>
</td>
</tr>
<tr>
<th>Extended `LevelN` constants</th>
<td>
<details>
<summary>❌️ No support</summary>
Only `Level1`..`Level8` are supported.
</details>
</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.11)</summary>
Since 1.11, the pattern `Level<INDEX>` can be used for any valid level index
`<INDEX>`.
Before 1.11, only `Level1`..`Level8` were supported.
</details>
</td>
</tr>
<tr>
<th>Extended include</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.11)</summary>
Enable *absolute* paths and *`%`-expansion*.
See @ref keymap-include-percent-expansion for further details.
</details>
</td>
</tr>
<!-- Removals -->
<tr>
<th>Include predefined maps</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>❌️ No support</summary>
The modern approach is to use [RMLVO].
</details>
</td>
</tr>
<tr>
<th>Exponent syntax for floating-point numbers</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>❌️ No support</summary>
@todo syntax description
</details>
</td>
</tr>
<tr>
<th>`alternate` merge mode</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>⚠️ Parsing, fallback to default merge mode</summary>
`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*.
</details>
</td>
</tr>
<tr>
<th>Multiple group definition in symbols section</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>⚠️ Supported, except in the [RMLVO] API</summary>
Since 1.8, only 1 group per symbol section is supported in the [RMLVO] API, to
avoid unintuitive results.
Multiple groups per symbol section is supported when parsing a [KcCGST] keymap.
</details>
</td>
</tr>
</tbody>
</table>
### API
<table>
<caption>API compatibility table</caption>
<thead>
<tr>
<th>Feature</th>
<th>X11</th>
<th>xkbcommon (v1 format)</th>
<th>xkbcommon (v2 format)</th>
</tr>
</thead>
<tbody>
<!-- Additions -->
<tr>
<th>Full Unicode support</th>
<td>❌️ Incomplete</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
Full support of simple case mappings for `xkb_keysym_to_lower()` and
`xkb_keysym_to_upper()`.
</details>
</td>
</tr>
<!-- TODO -->
<!-- Removals -->
<tr>
<th>[KcCGST] @anchor KcCGST-support</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>⚠️ Partial support (since 1.10)</summary>
- [KcCGST] is considered an implementation detail, use [RMLVO] instead.
- Use `xkb_component_names::xkb_components_names_from_rules()` for
debugging purposes.
</details>
</td>
</tr>
<tr>
<th>XKM file format</th>
<td>✅ Full support</td>
<td colspan="2">
<details>
<summary>❌️ No support</summary>
Obsolete legacy file format tied to X11 ecosystem.
</details>
</td>
</tr>
<!-- TODO -->
</tbody>
</table>
[KcCGST]: @ref KcCGST-intro
[RMLVO]: @ref RMLVO-intro
## Rules support {#rules-support}
<table>
<caption>API compatibility table</caption>
<thead>
<tr>
<th>Feature</th>
<th>X11</th>
<th>xkbcommon (v1 format)</th>
<th>xkbcommon (v2 format)</th>
</tr>
</thead>
<tbody>
<!-- Additions -->
<tr>
<th>`! include` statement</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support</summary>
See @ref rules-include-expansion "rules include statement" for further details.
</details>
</td>
</tr>
<tr>
<th>`replace` merge mode</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.9)</summary>
Support the merge mode *replace* via the prefix `^`, in addition to
the standard *merge* `|` and *override* `+` modes.
</details>
</td>
</tr>
<tr>
<th>Extended layout indices</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.8)</summary>
- *single*: matches a single layout; `layout[single]` is the same as without
explicit index: `layout`.
- *first*: matches the first layout/variant, no matter how many layouts are in
the RMLVO configuration. Acts as both `layout` and `layout[1]`.
- *later*: matches all but the first layout. This is an index range. Acts as
`layout[2]` .. `layout[MAX_LAYOUT]`, where `MAX_LAYOUT` is currently 4.
- *any*: matches layout at any position. This is an index range.
- the `:all` qualifier: it applies the qualified item to all layouts.
See @ref rules-extended-layout-indices "extended layout indices" for further
details.
</details>
</td>
</tr>
<tr>
<th>`:all` qualifier</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.8)</summary>
the `:all` qualifier: it applies the qualified item to all layouts.
See @ref rules-all-qualifier ":all qualifier" for further
details.
</details>
</td>
</tr>
<tr>
<th>Extended wild cards</th>
<td>❌️ No support</td>
<td colspan="2">
<details>
<summary>✅ Full support (since 1.9)</summary>
- `<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.
See @ref rules-wildcard-def "rules wildcards" for further information.
</details>
</td>
</tr>
<!-- Removals -->
<!-- TODO -->
</tbody>
</table>
<!-- TODO: tools. Move some of the FAQ entries here? -->
## Keyboard layout registry {#registry-support}
<table>
<caption>Keyboard layout registry support</caption>
<thead>
<tr>
<th>Feature</th>
<th>X11</th>
<th>xkbcommon</th>
</tr>
</thead>
<tbody>
<!-- Additions -->
<tr>
<th>XML format</th>
<td>❌️ No support</td>
<td>
<details>
<summary>✅ Full support</summary>
@todo rationale
</details>
</td>
</tr>
<!-- TODO -->
<!-- Removals -->
<!-- TODO -->
</tbody>
</table>
## Compose support {#compose-support}
Relative to the standard implementation in libX11 (described in the
Compose(5) man-page):
<table>
<caption>Compose support</caption>
<thead>
<tr>
<th>Feature</th>
<th>X11 (`libX11`)</th>
<th>xkbcommon</th>
</tr>
</thead>
<tbody>
<!-- Additions -->
<!-- TODO -->
<!-- Removals -->
<tr>
<th>`[!] MODIFIER` syntax</th>
<td>✅ Full support</td>
<td>
<details>
<summary>⚠️ Parsing only</summary>
Syntax: `[([!] ([~] 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.
@todo removal rationale
</details>
</td>
</tr>
<tr>
<th>Modifier keysyms in sequences</th>
<td>✅ Full support</td>
<td>
<details>
<summary>⚠️ Parsed, but key events are ignored</summary>
Modifiers should not be used in Compose sequences. Use keymap’s features or
a keysym with more appropriate semantics.
</details>
</td>
</tr>
<tr>
<th>Interactions with Braille keysyms</th>
<td>✅ Full support</td>
<td>
<details>
<summary>❌️ No support</summary>
@todo feature description, removal rationale
</details>
</td>
</tr>
<!-- TODO -->
</tbody>
</table>