Skip to content

fix: claim the Windows keys for a focused remote session - #42

Merged
LukeGus merged 1 commit into
Termix-SSH:dev-1.4.2from
ZacharyZcR:fix/rdp-keyboard-lock
Nov 16, 2026
Merged

LukeGus merged 1 commit into
Termix-SSH:dev-1.4.2from
ZacharyZcR:fix/rdp-keyboard-lock

Conversation

@ZacharyZcR

Copy link
Copy Markdown
Member

The same user reported that Windows key shortcuts do not reach the remote host. On Windows the local shell takes the Windows key and shortcuts such as Win+R before the page sees them. The Moonlight tab already requests a keyboard lock, but Guacamole sessions did not.

While the display captures keyboard input, request navigator.keyboard.lock(["MetaLeft", "MetaRight"]). Release it when capture stops (focus, window or tab loss) and when the client disconnects. The lock is tracked per display, so a hidden session refreshing its handlers cannot release the focused one's lock. A missing or refused Keyboard Lock API is ignored.

Browsers, including Electron, only honour the lock in fullscreen. Termix's app fullscreen uses requestFullscreen, so it applies there. Windowed sessions behave as before and keep the toolbar Win keys. Only the Windows keys are locked, so Escape still exits fullscreen normally.

Validation: tests cover lock and release through the display's actual focus callback, de-duplication, and browsers without the API. All 564 tests (1 skipped), typecheck, build, manifest validation and formatting passed. Not yet checked by hand on Windows.

@termix-triage-bot

termix-triage-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

AI review | Looks safe to merge

The change uses the Keyboard Lock API to capture Windows keys during focused remote sessions, safely handling missing APIs and errors. It includes tests and follows repository conventions, with no security or stability risks.

Reviewed a2d0355. AI can be wrong, a maintainer still decides. Comment /termix review to run it again.

@ZacharyZcR
ZacharyZcR force-pushed the fix/rdp-keyboard-lock branch from a077090 to ec760e0 Compare November 15, 2026 19:28
@ZacharyZcR
ZacharyZcR changed the base branch from main to dev-1.4.1 November 15, 2026 19:28
@termix-ci
termix-ci Bot deleted the branch Termix-SSH:dev-1.4.1 November 15, 2026 19:35
On Windows the local shell takes the Windows key and shortcuts such as Win+R
before the page sees them, so they never reached the remote desktop. The
Moonlight tab already asks for a keyboard lock; Guacamole sessions did not.

Request a keyboard lock on MetaLeft and MetaRight while the display captures
input and release it with the focus or the connection. Browsers only honour
the lock in fullscreen, so windowed sessions keep using the toolbar keys.
@ZacharyZcR
ZacharyZcR changed the base branch from dev-1.4.1 to dev-1.4.2 November 16, 2026 13:24

@LukeGus LukeGus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LukeGus
LukeGus merged commit 1a0dcd2 into Termix-SSH:dev-1.4.2 Nov 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants