Skip to content

Fix unintended Windows key switching - #6

Merged
onderaktas54 merged 1 commit into
masterfrom
agent/fix-windows-key-switch
Jul 16, 2026
Merged

Fix unintended Windows key switching#6
onderaktas54 merged 1 commit into
masterfrom
agent/fix-windows-key-switch

Conversation

@onderaktas54

Copy link
Copy Markdown
Owner

What changed

  • parses single-character hotkey tokens before enum parsing, so 1 and 2 map to keyboard VK codes instead of mouse button codes
  • releases Host-side Ctrl, Alt, Shift and both Windows keys whenever routing mode changes
  • marks those synthetic releases so they are never forwarded to the Client
  • registers global hotkeys with MOD_NOREPEAT to prevent held shortcuts from retriggering
  • adds Windows regression tests for Ctrl+Win+1, Ctrl+Alt+2, and Shift+A

Root cause

.NET Enum.TryParse accepts numeric strings as raw enum values. The old parser therefore interpreted 1 as VK_LBUTTON and 2 as VK_RBUTTON, rather than keyboard VK_1 and VK_2. A mode-switch modifier could also remain logically held on the Windows Host because its physical key-up was blocked after entering remote mode. Together, holding Win and clicking could match the malformed return-to-Host hotkey and switch routing unexpectedly.

Validation

  • Windows Host Release build: succeeded, 0 warnings
  • Windows hotkey test project: builds successfully on Linux with Windows targeting
  • Core tests: 20 passed
  • Linux tests: 8 passed
  • Windows regression tests are now part of the Windows CI job

@onderaktas54
onderaktas54 marked this pull request as ready for review July 16, 2026 20:53
@onderaktas54
onderaktas54 merged commit 9d908bf into master Jul 16, 2026
2 checks passed
@onderaktas54
onderaktas54 deleted the agent/fix-windows-key-switch branch July 16, 2026 20:53
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.

1 participant