Expand description
Seat keymap ownership: base layout plus batched overlay keysym binding. Compositor-side keymap policy: one owner for the seat keymap.
The seat keymap is BASE text (US by default, replaceable at runtime with a full XKB_KEYMAP_FORMAT_TEXT_V1 string or RMLVO names) plus an OVERLAY of spare keycodes bound to keysyms the base cannot produce (Unicode / IME output). All rebinds are batched: resolving N new keysyms produces ONE keymap swap, and a keycode that is currently held down is never recycled, so its release event always means the symbol its press meant.
Structs§
- Keymap
Policy - Seat keymap state: the base text, its reverse keysym map, and the overlay slots.
Constants§
- OVERLAY_
CAPACITY - Overlay slot count (keycodes
OVERLAY_FIRST..=OVERLAY_LAST). - OVERLAY_
FIRST_ KEYCODE - First overlay keycode. Sits above both the evdev/pc105 range and the legacy selkies overlay range (257-272) so a base keymap carrying those legacy binds cannot collide.
- OVERLAY_
LAST_ KEYCODE - Last overlay keycode (inclusive). Keycodes past the X11 255 ceiling are fine for pure-Wayland clients: they look keycodes up in the delivered keymap via xkbcommon.
Functions§
- compile_
keymap - Compile an XKB_KEYMAP_FORMAT_TEXT_V1 string, or
Nonewhen it does not compile. - compile_
rmlvo - Compile RMLVO names to keymap text, or
Nonewhen compilation fails. Empty strings select the xkbcommon defaults for that component. - keysym_
for_ char - Keysym one literal character types as: Latin-1 printables map 1:1,
\ntypes Return (the raw utf32 table maps it to Linefeed, which no keymap binds), other control characters their0xffXXfunction keysyms, everything else the0x01000000 | codepointUnicode form (0 = unmappable). The keysym then resolves against an ACTIVE keymap, never a hardcoded layout table. - level0_
syms - Level-0 keysym for every key of a compiled keymap (used to pre-bind a virtual-keyboard client’s keymap in one batch). Keys with zero or multiple level-0 syms are skipped.