Skip to content

Implement sticky keys on Wayland

Nicolas Fella requested to merge work/nico/sticky-keys into master

Sticky keys allow to trigger key combinations one key at a time.

This is an accessibility feature used by people that cannot press multiple keys simultaneously.

On X11 this is handled by the X server, configured via kaccess.

On Wayland we get to handle this ourselves.

wl_keyboard events already carry the modifier's latched/locked state, so all we need to do is to make sure the right state is set

Xkb gains a new method to set the state. The business logic is implemented in a new plugin that filters for keys and sets the Xkb state accordingly.

BUG: 444335

This is a barebones implementation. Some aspects are missing:

  • Locking modifiers
  • Disabling when two keys are held down
  • Notify when locked/latched
Edited by Nicolas Fella

Merge request reports