Repository navigation
fix: sync Num Lock for keypad keys in the built-in RDP engine - #41
Merged
Merged
Conversation
|
AI review | Looks safe to merge The PR fixes keypad digit input in RDP sessions by tracking and syncing the server's Num Lock state before sending keypad keys. The implementation is isolated, includes passing tests, and introduces no security or stability risks. Reviewed 1f5e2a0. AI can be wrong, a maintainer still decides. Comment |
ZacharyZcR
force-pushed
the
fix/keypad-num-lock
branch
from
November 15, 2026 19:28
518ef5b to
c7ee930
Compare
The engine turned the server's Num Lock off on connect and never synced it again. The server reads a keypad scancode by its own Num Lock, so with Num Lock on locally the keypad digits arrived as navigation keys and typed no numbers. Track the server's lock state and, like guacd, set Num Lock to what a keypad keysym means before sending it: on for digits and the decimal point, off for the keypad navigation keys. A reconnect restores the tracked state instead of clearing it.
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.
A user on Windows 11 / Server 2025 x64 reported that keypad digits do not type in RDP sessions even with Num Lock on.
The built-in engine sends
sync_locks(false, false, false)on connect and never syncs the locks again. The server reads a keypad scancode by its own Num Lock, so with Num Lock on locally, KP_1 (scancode 0x4F) arrived as End.The keyboard now tracks the server's lock state and, like guacd's keymap lock requirements, sets Num Lock to what a keypad keysym means before sending it: on for digits, the decimal point and separator, and off for the keypad navigation keys. Pressing Num Lock in the session updates the tracked state. A reconnect restores the tracked state instead of clearing it, and Caps Lock is carried along in every sync. guacd mode is unchanged.
Validation: three new keyboard tests fail before the change and pass after it. All 564 tests (1 skipped), typecheck, build, manifest validation and formatting passed. Not yet checked by hand against a live Windows host.