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

Merged
wike1701 merged 1 commit from upstream-pr/32 into main 2026-11-27 11:00:23 +00:00
wike1701 commented 2026-11-27 10:54:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by wike1701 on 2026-11-27T10:54:01Z.


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
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5525412107 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/32). Originally posted by [wike1701](https://github.com/wike1701) on 2026-11-27T10:54:01Z. --- ### 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**
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!32
No description provided.