Repository navigation
fix(input): the movement and camera keys hide the game menus' cursor again - #2664
jarynclouatre wants to merge 1 commit into
Conversation
…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
left a comment
There was a problem hiding this comment.
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.
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_showninhost/display.chides the cursor oncehos_player_input_nsis newer than the mouse's last use.read_inputstamped that time for the movement and camera keys withif (keys[0] || keys[1] || keys[2] || keys[3]) player_used();, and #2617 replaced that line with itshos_mouse_native_stickcall. 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.pychecks thatread_inputstamps 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.pyandtests/test_mouse_native.pypass. Not run in the game: the cursor with the keyboard was not checked by hand on Windows.