Repository navigation
fix(input): run low-level hooks on a dedicated thread; use hook-time cursor - #75
Merged
Merged
Conversation
…cursor The WH_MOUSE_LL/WH_KEYBOARD_LL hooks were installed from the WPF UI thread, so every mouse event on the system (including in-game movement) waited behind UI work such as WebView layout or a synchronous engine rebuild, and Windows can silently drop a hook that misses LowLevelHooksTimeout (hotkeys then stop until restart). - Install the hooks on an AboveNormal background thread with its own message loop; Stop posts WM_QUIT and the thread unhooks on exit. - Capture the cursor position in the hook (MSLLHOOKSTRUCT.pt for mouse, GetCursorPos for keyboard) and scan at that point instead of reading the cursor later on the thread pool. - HotkeySelector now marshals hook callbacks onto the renderer. Verified on a Release build: injected Shift key events reach the hook thread (debug log), shutdown joins it cleanly (exit 0), UI smoke passes. Claude-Session: https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 13 minutes. View limit details
|
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.
Change
Install low-level keyboard and mouse hooks on an AboveNormal background thread with a ready Win32 message queue. Shutdown posts WM_QUIT and waits up to two seconds for unhooking; startup failures preserve rollback behavior.
Capture the physical cursor in the hook and pass it through delayed scan dispatch. Marshal HotkeySelector updates onto its Blazor renderer. Non-button mouse events bypass payload unmarshalling on the high-frequency input path.
Validation
Limits
No live EFT session was available. In-game hitch reduction and Shift+mouse combination timing remain unmeasured. No dependency or security policy changes; no release publication.