[ANNOUNCE] kbvm

Julian Orth ju.orth at gmail.com
Wed Jan 22 10:23:11 UTC 2025


kbvm is a new implementation of the XKB specification and some other
protocols from the XKB ecosystem. It supports

- creating keymaps from buffers,
- creating keymaps from RMLVO names,
- creating keymaps from X11 connections,
- loading and handling of XCompose files, and
- loading the RMLVO registry.

Keymaps can be turned into compositor-side state machines and
client-side lookup tables.

kbvm should support most of the features of xkbcommon. It also
supports some XKB features that have not yet been implemented in
xkbcommon:

- all key behaviors:
    - locking
    - overlays
    - radio groups
- the RedirectKey action
- the SetControls and LockControls actions
    - the state machine ignores all but the overlay controls
- support for up to 32 groups per key

You can find more information about it in the [documentation] and the
[repository].

kbvm should be mostly compatible with xkbcommon 1.7 and the X server.
Some known differences are documented in a [compatibility] file.

---

You can try kbvm with the [cli]. You can install the cli via

    cargo install kbvm-cli --locked

This will install the `kbvm` binary under `~/.cargo/bin/kbvm`.

The state machine can be tested with the `test-wayland` subcommand:

    kbvm test-wayland --keymap map.xkb

where `map.xkb` should contain an XKB keymap. This command will treat
wl_keyboard.key events as raw inputs and run them through the state
machine similar to how a compositor would handle libinput key events.

You can find more information about the cli at [cli] or by using
`--help`.

---

kbvm contains a number of [compile tests] and [state machine tests]
that might also be of interest to other implementations.

---

[documentation]: https://docs.rs/kbvm
[repository]: https://github.com/mahkoh/kbvm
[compatibility]:
https://github.com/mahkoh/kbvm/blob/master/docs/compatibility.md
[cli]: https://github.com/mahkoh/kbvm/tree/master/kbvm-cli
[compile tests]:
https://github.com/mahkoh/kbvm/tree/master/compile-tests/testcases
[state machine tests]:
https://github.com/mahkoh/kbvm/tree/master/type-tests/testcases


More information about the wayland-devel mailing list