Skip to content

fix(input): run low-level hooks on a dedicated thread; use hook-time cursor - #75

Merged
DysektAI merged 7 commits into
masterfrom
fix/input-hook-thread
Nov 2, 2026
Merged

DysektAI merged 7 commits into
masterfrom
fix/input-hook-thread

Conversation

@DysektAI

@DysektAI DysektAI commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

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.

…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
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 56 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 9af80c2e-0058-46f3-a6e9-6e9a04881b8c
Commits

Reviewing files that changed from the base of the PR and between d077985 and 89bcd62.

Files selected for processing: 4
  • docs/agent-context/architecture.md
  • src/App/Components/HotkeySelector.razor
  • src/App/HotkeyManager.cs
  • src/App/UserActivityHelper.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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