From e60cb2f28ada7b37b62f882857f237af04e93a08 Mon Sep 17 00:00:00 2001 From: DeeJanuz <45082401+DeeJanuz@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:35:16 -0600 Subject: [PATCH] Add a report script for keys that stick or leak scripts/keys-report.py records what happens to the modifiers, Tab, and Esc while someone reproduces a key problem: each press, release, and autorepeat as the relay reads it from a physical keyboard, and as it comes out of the relay's virtual keyboard to gamescope and SteamVR. It adds the relay's view of every device (role, grabbed), which programs have each input node open, and the relay, pointer helper, and desktop logs for the same time. Other keys show only as "other key", so nothing typed ends up in the report, and Bluetooth addresses are masked. For #2: Shift+Tab in the Frametop desktop opened the SteamVR dashboard and then stayed held, which doesn't happen here. Co-Authored-By: Claude Opus 5.5 --- docs/hazards.md | 1 + scripts/keys-report.py | 211 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+) create mode 100755 scripts/keys-report.py diff --git a/docs/hazards.md b/docs/hazards.md index 933a5e0..d449a93 100644 --- a/docs/hazards.md +++ b/docs/hazards.md @@ -18,6 +18,7 @@ ft-screens drops keys while no screen has focus or the SteamVR dashboard is open - **A release that never arrives leaves the key held in the desktop.** KWin repeats held keys itself, so a stuck letter repeats and a stuck modifier changes every later key (Ctrl+Alt held turns T into Konsole). Pressing and releasing the key again clears it. - **A keyboard that disconnects mid-press is one way to get there.** The relay forgets the held key without telling ft-screens. The same goes for the relay restarting while a key is down. +- **To see where a key went,** run `scripts/keys-report.py` and reproduce the problem while it records. It logs the modifiers, Tab, and Esc (no other keys) as the relay reads them and as its virtual keyboard sends them on, with the device roles and grabs, which programs have each keyboard open, and the relay's and desktop's logs. - **Switching where typing goes waits for keys to come up.** The relay changes a keyboard's grab only while none of its keys are down, so a press and its release go to the same side. A key held for a long time delays the switch until it's let go. ## Typing and grabbed keyboards diff --git a/scripts/keys-report.py b/scripts/keys-report.py new file mode 100755 index 0000000..afa0606 --- /dev/null +++ b/scripts/keys-report.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python3 +"""Record what happens to a key combination, for a report on stuck or leaking keys. + +Run it on the Frame (a terminal, or `ssh frame python3 - < scripts/keys-report.py`), then +reproduce the problem while it records (40 seconds by default): + scripts/keys-report.py [seconds] +It writes ~/frametop-keys-report-