Add key state OSD for debugging
Some checks are pending
labwc.github.io / notify (push) Waiting to run

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 committed by Johan Malm
parent c4fd916fd3
commit c8bb3381a4
5 changed files with 181 additions and 1 deletions

View file

@ -21,6 +21,7 @@
#include "cycle.h"
#include "debug.h"
#include "input/keyboard.h"
#include "input/key-state.h"
#include "labwc.h"
#include "magnifier.h"
#include "menu/menu.h"
@ -133,7 +134,8 @@ struct action_arg_list {
X(ZOOM_IN, "ZoomIn") \
X(ZOOM_OUT, "ZoomOut") \
X(WARP_CURSOR, "WarpCursor") \
X(HIDE_CURSOR, "HideCursor")
X(HIDE_CURSOR, "HideCursor") \
X(DEBUG_TOGGLE_KEY_STATE_INDICATOR, "DebugToggleKeyStateIndicator")
/*
* Will expand to:
@ -1570,6 +1572,9 @@ run_action(struct view *view, struct action *action,
case ACTION_TYPE_HIDE_CURSOR:
cursor_set_visible(&server.seat, false);
break;
case ACTION_TYPE_DEBUG_TOGGLE_KEY_STATE_INDICATOR:
key_state_indicator_toggle();
break;
case ACTION_TYPE_INVALID:
wlr_log(WLR_ERROR, "Not executing unknown action");
break;