Add key state OSD for debugging

Add action `DebugToggleKeyStateIndicator` to show in the top-left corner
the pressed, bound, pressed-sent keys as well as modifiers.

This should help fault find issues like #2771 and #3238

Based-on: #3262
Co-authored-by: @tokyo4j
This commit is contained in:
Johan Malm 2026-04-06 21:57:24 +01:00
parent fee38bceca
commit d2ea245dc1
5 changed files with 182 additions and 1 deletions

View file

@ -5,12 +5,17 @@
#include <stdbool.h>
#include <stdint.h>
struct seat;
/*
* All keycodes in these functions are (Linux) libinput evdev scancodes which is
* what 'wlr_keyboard' uses (e.g. 'seat->keyboard_group->keyboard->keycodes').
* Note: These keycodes are different to XKB scancodes by a value of 8.
*/
void key_state_indicator_update(struct seat *seat);
void key_state_indicator_toggle(void);
/**
* key_state_pressed_sent_keycodes - generate array of pressed+sent keys
* Note: The array is generated by subtracting any bound keys from _all_ pressed