fix(hle): suppress mouse motion and buttons while the F1 settings menu is open #32

Manually merged
github merged 1 commit from github-bot/gh-32 into gh-pr/32/base 2026-11-27 11:02:39 +00:00 AGit
Owner

@⁠wike1701 on GitHub · 2026-11-27 10:54 UTC · original
wike1701:fix/suppress-mouse-in-f1-menu → main · +45 −7 · 1 files · 1 commits · merged 2026-11-27 11:00 UTC

Problem

\Host::keys\ already returns empty input while the F1 settings menu is open (\ ictory_gpu::SETTINGS_MENU_OPEN), but \Host::mouse\ did not check it. With \VICTORY_MOUSE_CAPTURE=1, moving or clicking the mouse while the F1 menu was open still rotated the in-game camera and sent mouse clicks to the game behind the overlay.

Fix

  • Check \ ictory_gpu::SETTINGS_MENU_OPEN\ in \Host::mouse\ (while still polling \captured_mouse_delta()\ so the cursor reference stays current and closing F1 produces no camera jump).
  • Discard motion deltas and clear button bits while the menu is open, keeping the virtual mouse connected at its preserved position (no disconnect/reconnect churn).
  • Add unit test \mouse_motion_and_buttons_are_suppressed_while_settings_menu_is_open.

Verification

  • \cargo test -p victory-hle --lib modules::gameinput\ -> 17 passed, 0 failed
  • \cargo xtask policy\ -> 280 files ok
**@⁠wike1701** on GitHub · 2026-11-27 10:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/32) `wike1701:fix/suppress-mouse-in-f1-menu` → `main` · +45 −7 · 1 files · 1 commits · merged 2026-11-27 11:00 UTC ### Problem \Host::keys\ already returns empty input while the F1 settings menu is open (\ ictory_gpu::SETTINGS_MENU_OPEN\), but \Host::mouse\ did not check it. With \VICTORY_MOUSE_CAPTURE=1\, moving or clicking the mouse while the F1 menu was open still rotated the in-game camera and sent mouse clicks to the game behind the overlay. ### Fix - Check \ ictory_gpu::SETTINGS_MENU_OPEN\ in \Host::mouse\ (while still polling \captured_mouse_delta()\ so the cursor reference stays current and closing F1 produces no camera jump). - Discard motion deltas and clear button bits while the menu is open, keeping the virtual mouse connected at its preserved position (no disconnect/reconnect churn). - Add unit test \mouse_motion_and_buttons_are_suppressed_while_settings_menu_is_open\. ### Verification - \cargo test -p victory-hle --lib modules::gameinput\ -> **17 passed, 0 failed** - \cargo xtask policy\ -> **280 files ok**
Host::keys already suppresses keyboard input when victory_gpu::SETTINGS_MENU_OPEN is set, but Host::mouse did not. With VICTORY_MOUSE_CAPTURE=1, moving or clicking the mouse while the F1 menu was open still rotated the in-game camera and sent clicks to the game.

Keep calling captured_mouse_delta() so the cursor reference stays current, discard the delta and clear button bits while SETTINGS_MENU_OPEN is true, and keep the virtual mouse connected at its preserved position so closing F1 produces no camera jump or disconnect/reconnect churn.

Tested with cargo test -p victory-hle --lib modules::gameinput (17 passed, 0 failed) and cargo xtask policy (280 files ok).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:56:18 +00:00
github-bot changed target branch from main to gh-pr/32/base 2026-11-27 11:02:38 +00:00
github manually merged commit 86a3976007 into gh-pr/32/base 2026-11-27 11:02:39 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.