feat(windows): server-side key anchoring#172
Draft
stefanverleysen wants to merge 5 commits intomasterfrom
Draft
Conversation
Per-screen anchoredKeys option keeps specified keys and combos local on the server instead of relaying them to clients. Supports single keys (F13, Delete), modifier combos (Alt+Tab, Ctrl+A), and arbitrary VK codes via a 256-bit bitmask. Combos use a pending-modifier mechanism that holds modifier keys until the next keypress determines whether to anchor locally or flush to the client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Repurpose unused lParam bit 30 to carry LLKHF_INJECTED so the combo handler can distinguish physical keypresses from its own SendInput events. Prevents infinite re-entry on combo repeat and modifier-UP paths. Keys that are both combo triggers and bare-anchored now enter the combo state machine correctly instead of short-circuiting. Combo state is cleared on mode transitions to prevent stale holdover. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
injectComboLocally fired a full down+up cycle on every keypress, causing held keys to produce rapid press-release instead of a sustained hold. Split into injectComboLocally (downs only) and releaseComboLocally (ups on physical release). Extracted sendInputToTarget to share the foreground-flip logic. Added !isInjected guard on trigger-UP path to prevent infinite SendInput loop. Combo state cleanup on mode transitions now includes g_firedModCount. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VK_CANCEL wrapping in sendInputToTarget so injected events bypass the hook instead of being relayed to the client. Clear g_keyState on mode change to prevent stale modifier state. Remove isInjected guards that blocked pedal (SendInput) events from releasing combos. Order-independent trigger buffering for simultaneous key arrival.
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.
Summary
To test
anchoredKeys = Ctrl+Shift+F6on the server screen