fix(input): the movement and camera keys hide the game menus' cursor again #2664

Closed
jarynclouatre wants to merge 1 commit from jarynclouatre/fix/keys-hide-menu-cursor into main
jarynclouatre commented 2026-11-12 04:45:51 +00:00 (Migrated from github.com)

Since #2617, the mouse cursor over the game's own menus stays on screen after the mouse moved, while the player carries on with WASD, the arrows or the camera keys. Only a pad or a bound Switch button hid it again.

gm_cursor_shown in host/display.c hides the cursor once hos_player_input_ns is newer than the mouse's last use. read_input stamped that time for the movement and camera keys with if (keys[0] || keys[1] || keys[2] || keys[3]) player_used();, and #2617 replaced that line with its hos_mouse_native_stick call. The line is back, next to the new call. Nothing else reads the stamp, and the native mouse's handover is unchanged.

tests/test_keys_player_input.py checks that read_input stamps the player's input after the keys' stick values, and that the cursor reads that stamp. It fails on main and passes here.

Testing: Linux, game-free: tests/test_keys_player_input.py (fails on main, passes with the fix), tests/test_input_background.py and tests/test_mouse_native.py pass. Not run in the game: the cursor with the keyboard was not checked by hand on Windows.

Since #2617, the mouse cursor over the game's own menus stays on screen after the mouse moved, while the player carries on with WASD, the arrows or the camera keys. Only a pad or a bound Switch button hid it again. `gm_cursor_shown` in `host/display.c` hides the cursor once `hos_player_input_ns` is newer than the mouse's last use. `read_input` stamped that time for the movement and camera keys with `if (keys[0] || keys[1] || keys[2] || keys[3]) player_used();`, and #2617 replaced that line with its `hos_mouse_native_stick` call. The line is back, next to the new call. Nothing else reads the stamp, and the native mouse's handover is unchanged. `tests/test_keys_player_input.py` checks that `read_input` stamps the player's input after the keys' stick values, and that the cursor reads that stamp. It fails on main and passes here. **Testing:** Linux, game-free: `tests/test_keys_player_input.py` (fails on main, passes with the fix), `tests/test_input_background.py` and `tests/test_mouse_native.py` pass. Not run in the game: the cursor with the keyboard was not checked by hand on Windows.
Owner

@Joey-Magnus approved on GitHub · 2026-11-12 14:33 UTC · original

I confirmed the regression: git log -S shows #2617 (8568959d) removed if (keys[0] || keys[1] || keys[2] || keys[3]) player_used(); from read_input, and nothing else stamps hos_player_input_ns for the movement and camera keys. On main, player_used() is only called for pads and bound buttons (host/nn_hid.c:997/1001). So gm_cursor_shown kept the cursor up while the player used WASD or the camera keys.

The line is back at host/nn_hid.c:1037, before hos_mouse_native_stick, which is unchanged. I merged into current main and ran tests/test_keys_player_input.py, test_mouse_native.py and test_input_background.py: all pass, and CI is green. No other open PR changes these lines. #2747 and #2604 touch nn_hid.c but elsewhere.

> [@Joey-Magnus](https://github.com/Joey-Magnus) approved on GitHub · 2026-11-12 14:33 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2664#pullrequestreview-5876228041) I confirmed the regression: `git log -S` shows #2617 (8568959d) removed `if (keys[0] || keys[1] || keys[2] || keys[3]) player_used();` from `read_input`, and nothing else stamps `hos_player_input_ns` for the movement and camera keys. On main, `player_used()` is only called for pads and bound buttons (host/nn_hid.c:997/1001). So `gm_cursor_shown` kept the cursor up while the player used WASD or the camera keys. The line is back at host/nn_hid.c:1037, before `hos_mouse_native_stick`, which is unchanged. I merged into current main and ran tests/test_keys_player_input.py, test_mouse_native.py and test_input_background.py: all pass, and CI is green. No other open PR changes these lines. #2747 and #2604 touch `nn_hid.c` but elsewhere. <!-- github-sync:r:5876228041 -->
github-sync closed this pull request 2026-11-12 17:58:21 +00:00
Commenting is not possible because the repository is archived.
No description provided.