Skip to content

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

Open
jarynclouatre wants to merge 1 commit into
NotRexed:mainfrom
jarynclouatre:fix/keys-hide-menu-cursor
Open

jarynclouatre wants to merge 1 commit into
NotRexed:mainfrom
jarynclouatre:fix/keys-hide-menu-cursor

Conversation

@jarynclouatre

Copy link
Copy Markdown
Contributor

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.

…again

NotRexed#2617 replaced the line in read_input that counted the movement and camera keys as the player's input
(player_used) with its own hos_mouse_native_stick call. Without it, the cursor over the game's menus
(display.c gm_cursor_shown) stays shown after the mouse moved, while the player goes on with WASD or the
camera keys: only the pads and the bound Switch buttons hid it again. The line is back next to the new call.

@Joey-Magnus Joey-Magnus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed the regression: git log -S shows #2617 (8568959) 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.

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.

2 participants