Repository navigation
fix: claim the Windows keys for a focused remote session - #42
Merged
Merged
Conversation
|
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 |
ZacharyZcR
force-pushed
the
fix/rdp-keyboard-lock
branch
from
November 15, 2026 19:28
a077090 to
ec760e0
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.