fix(input): the mouse points at the ocarina song sheet's songs while ZL is held (#1253) #1640

Merged
HumanBean merged 2 commits from cuecuemoar/Longshot:fix/songbook-mouse-hover into main 2026-11-20 22:57:02 +00:00
Contributor

Summary

The ocarina's song sheet opens only while ZL is held. With ZL on a controller or on the Z key, moving the mouse over the songs often did not select them: the game counted the held ZL as the player using the pad, which hides the mouse cursor again right after the mouse showed it. A button or key that stays held no longer hides the cursor; pressing one still does, and so do the sticks. To see the bug on main (Windows 10, RTX 4090, main e090cc48): load an adult save with the ocarina (the Lost Woods), take the ocarina out, hold ZL on a pad button or the Z key (not on the right mouse button, whose own bug is #1130) and move the mouse over the songs: the selection often does not follow it. With this change each song under the mouse is selected.

Read first: read_input in host/nn_hid.c, which now keeps the buttons and keys that were down at the last read (down_was) and stamps the player's input only for one that was not, and the held-input case in tests/input_background_test.c. tests/test_pads_after_menu.py's cut of read_input gets the new mask it writes to (no assertion changed). The README sentence about the hidden cursor, which an earlier version of this change extended, left the README when the player docs moved to docs/user/ (#1802), so the README is not changed; and docs/tested/ is gone from main (#1856), so the runs by hand are written down here, in Testing and Measurements, not in run files. Fixes #1253.

Testing

Tested: By hand on my own PC (Windows 10, RTX 4090, Core i9-13900K): rt-main shows the song sheet's mouse hover failing with ZL held, and the runtime of this change (built at 4cf1c744: the same code, before two rebases) points at the songs (Windows 10 Pro 22H2, RTX 4090 with the driver recorded on 2026-11-16, 617.42, Core i9-13900K, 32 GB). I did not record which controller it was, nor whether ZL was on the pad or the Z key. Game-free: the held-input case fails on main for the reason in Measurements and passes here, and it also fails when the fix's key line is made to stamp at every read again. test_input_background, test_pads_after_menu, test_keys_player_input, test_cursor_hidden_in_play, test_bound_keys and test_game_menu_mouse_buttons pass at c07b0136.

The whole suite (tests/run_all.py in WSL on Ubuntu 22.04, without --strict) at 5eaa02e5 and at its base, main 6d25da8c: 795 passed, 69 failed, 18 skipped on the PR head; 794 passed, 70 failed, 18 skipped on main. No check fails only on the PR head: 68 check files fail on it and the same 68 fail on main, and main also fails test_longshot_ctl, which is flaky under load (it passes 3 of 3 alone on both). They are named in the comment posted with this description (2026-11-20). One check is skipped here because dav1d is not installed, and --strict would fail it. The last rebase, onto one more main commit (2210931c, host/nn_os_sync.c, a switch row and its own test, nothing nn_hid.c includes), ran the checks that read nn_hid.c again, not the whole suite.

Linux, at c07b0136 (on main 2210931c) on Ubuntu 22.04 under WSL2, with the Linux build tools of tools.lock (clang 23.1.5 and its sysroot): the renderer builds (scripts/dev.py vk, 0 files failed, its exports checked). host/nn_hid.c, the only host file this PR changes, compiles to an object file with the build's flags (host/posix/windows.h standing in for Windows'), against the headers rtgen writes and an empty stand-in for the lifter's a64_fpx.h. It gives the same 62 -Wall -Wextra warnings as on main, with the same messages and counts, so none is new. The 29 check files that read nn_hid.c ran there: 27 pass, and test_walk_key and test_host_guest_writes fail on main too. Not linked, and the game was not run on Linux: no game was built there, and WSL cannot run it.

Still to test: None. (Not run: the game on Linux.)

Measurements

Verdict: nothing to measure in frame time: the change adds a mask compare to each read of the controls and no draw, wait or allocation. The behaviour is shown by the game-free case (fails on main, passes here) and by the run by hand.

Setup: Windows 10 Pro 22H2, RTX 4090, Core i9-13900K, 32 GB; the Lost Woods (adult), the ocarina's song sheet, ZL held. The game-free case is python -I -B tests/test_input_background.py --case held-input; on main it is run with only this PR's test commit applied. By hand: rt-main (main) and a dev_packs.py pack of this change.

Before: main @ 2210931c After: this PR @ c07b0136
held-input (stamps after one press and five more reads with Z held) fails: FAIL:305 player_stamps == 1 passes
the song sheet by hand, ZL held, mouse moved over the songs the mouse does not point reliably (by hand, on the runtime at e090cc48) the mouse points at the songs (by hand, built at 4cf1c744)
Before (main 2210931c + the test commit):  FAIL:305 player_stamps == 1
After (c07b0136):  PASS: an input held down is the player's input when it goes down, not at every read

Risks

The player's-input stamp, which hides the game menus' cursor, is now made once when an input goes down: a held button no longer hides a cursor the mouse showed. A pad button that goes down and up between two reads (under one frame) is missed by the stamp, as it was by the buttons themselves. A revert is enough to turn it off. Nothing changes for players after updating: nothing is saved or written, and the options and the caches are untouched.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (Rebased onto main 2210931c when pushed.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (tests/run_all.py without --strict: no check fails only on the PR head; the 68 files that fail on it also fail on main, named in the comment posted with this description; see Testing.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: built as a pack and run. Linux: the renderer and host/nn_hid.c built on Ubuntu 22.04 under WSL2 at c07b0136, not linked or run: see Testing.)
  • Docs updated. (None left to update: the README sentence this change extended no longer exists, see Summary.)
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary The ocarina's song sheet opens only while ZL is held. With ZL on a controller or on the Z key, moving the mouse over the songs often did not select them: the game counted the held ZL as the player using the pad, which hides the mouse cursor again right after the mouse showed it. A button or key that stays held no longer hides the cursor; pressing one still does, and so do the sticks. To see the bug on main (Windows 10, RTX 4090, main e090cc48): load an adult save with the ocarina (the Lost Woods), take the ocarina out, hold ZL on a pad button or the Z key (not on the right mouse button, whose own bug is #1130) and move the mouse over the songs: the selection often does not follow it. With this change each song under the mouse is selected. Read first: `read_input` in `host/nn_hid.c`, which now keeps the buttons and keys that were down at the last read (`down_was`) and stamps the player's input only for one that was not, and the `held-input` case in `tests/input_background_test.c`. `tests/test_pads_after_menu.py`'s cut of `read_input` gets the new mask it writes to (no assertion changed). The README sentence about the hidden cursor, which an earlier version of this change extended, left the README when the player docs moved to `docs/user/` (#1802), so the README is not changed; and `docs/tested/` is gone from main (#1856), so the runs by hand are written down here, in Testing and Measurements, not in run files. Fixes #1253. ## Testing **Tested:** By hand on my own PC (Windows 10, RTX 4090, Core i9-13900K): `rt-main` shows the song sheet's mouse hover failing with ZL held, and the runtime of this change (built at 4cf1c744: the same code, before two rebases) points at the songs (Windows 10 Pro 22H2, RTX 4090 with the driver recorded on 2026-11-16, 617.42, Core i9-13900K, 32 GB). I did not record which controller it was, nor whether ZL was on the pad or the Z key. Game-free: the `held-input` case fails on main for the reason in Measurements and passes here, and it also fails when the fix's key line is made to stamp at every read again. `test_input_background`, `test_pads_after_menu`, `test_keys_player_input`, `test_cursor_hidden_in_play`, `test_bound_keys` and `test_game_menu_mouse_buttons` pass at c07b0136. The whole suite (`tests/run_all.py` in WSL on Ubuntu 22.04, without `--strict`) at 5eaa02e5 and at its base, main 6d25da8c: 795 passed, 69 failed, 18 skipped on the PR head; 794 passed, 70 failed, 18 skipped on main. No check fails only on the PR head: 68 check files fail on it and the same 68 fail on main, and main also fails `test_longshot_ctl`, which is flaky under load (it passes 3 of 3 alone on both). They are named in the comment posted with this description (2026-11-20). One check is skipped here because dav1d is not installed, and `--strict` would fail it. The last rebase, onto one more main commit (2210931c, `host/nn_os_sync.c`, a switch row and its own test, nothing `nn_hid.c` includes), ran the checks that read `nn_hid.c` again, not the whole suite. Linux, at c07b0136 (on main 2210931c) on Ubuntu 22.04 under WSL2, with the Linux build tools of `tools.lock` (clang 23.1.5 and its sysroot): the renderer builds (`scripts/dev.py vk`, 0 files failed, its exports checked). `host/nn_hid.c`, the only host file this PR changes, compiles to an object file with the build's flags (`host/posix/windows.h` standing in for Windows'), against the headers `rtgen` writes and an empty stand-in for the lifter's `a64_fpx.h`. It gives the same 62 `-Wall -Wextra` warnings as on main, with the same messages and counts, so none is new. The 29 check files that read `nn_hid.c` ran there: 27 pass, and `test_walk_key` and `test_host_guest_writes` fail on main too. Not linked, and the game was not run on Linux: no game was built there, and WSL cannot run it. **Still to test:** None. (Not run: the game on Linux.) ## Measurements **Verdict:** nothing to measure in frame time: the change adds a mask compare to each read of the controls and no draw, wait or allocation. The behaviour is shown by the game-free case (fails on main, passes here) and by the run by hand. Setup: Windows 10 Pro 22H2, RTX 4090, Core i9-13900K, 32 GB; the Lost Woods (adult), the ocarina's song sheet, ZL held. The game-free case is `python -I -B tests/test_input_background.py --case held-input`; on main it is run with only this PR's test commit applied. By hand: `rt-main` (main) and a `dev_packs.py` pack of this change. | | Before: main @ 2210931c | After: this PR @ c07b0136 | |---|---|---| | `held-input` (stamps after one press and five more reads with Z held) | fails: `FAIL:305 player_stamps == 1` | passes | | the song sheet by hand, ZL held, mouse moved over the songs | the mouse does not point reliably (by hand, on the runtime at e090cc48) | the mouse points at the songs (by hand, built at 4cf1c744) | ``` Before (main 2210931c + the test commit): FAIL:305 player_stamps == 1 After (c07b0136): PASS: an input held down is the player's input when it goes down, not at every read ``` ## Risks The player's-input stamp, which hides the game menus' cursor, is now made once when an input goes down: a held button no longer hides a cursor the mouse showed. A pad button that goes down and up between two reads (under one frame) is missed by the stamp, as it was by the buttons themselves. A revert is enough to turn it off. Nothing changes for players after updating: nothing is saved or written, and the options and the caches are untouched. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. (Rebased onto main 2210931c when pushed.) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). (`tests/run_all.py` without `--strict`: no check fails only on the PR head; the 68 files that fail on it also fail on main, named in the comment posted with this description; see Testing.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: built as a pack and run. Linux: the renderer and `host/nn_hid.c` built on Ubuntu 22.04 under WSL2 at c07b0136, not linked or run: see Testing.) - [x] Docs updated. (None left to update: the README sentence this change extended no longer exists, see Summary.) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
The game menus' cursor hides when the player's input is newer than the mouse's (host/display.c gm_cursor_shown). read_input
stamps that input at every read while a button or a bound key is down, so a ZL held for the ocarina's song sheet kept the cursor
hidden: each mouse move showed it, and the next read hid it again before the menu pointed. The case goes through the real
read_input: five more reads with Z held stamp five more times on main.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZk7YzdoyMsjiAMs7p8
Assisted-by: Claude Code
read_input stamped the player's input (which hides the game menus' cursor until the mouse moves) at every read while a pad
button or a bound key was down. The song sheet is open only while ZL is held, so with ZL on a pad or on a key each mouse move
showed the cursor and the next read hid it again before the menu pointed: the hover took a song only when a move landed
between two reads, and the choice looked random.

An input now counts when it goes down: a button that was not down at the last read. One that stays held no longer hides the
cursor again; a new press, and the sticks, still do. test_pads_after_menu's fixture gets read_input's new mask for the block it cuts.

Fixes #1253

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZk7YzdoyMsjiAMs7p8
Assisted-by: Claude Code
docs(tested): the song sheet's mouse hover with ZL held, main and the fix, by hand (#1253)
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 22s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
708f985e11
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZk7YzdoyMsjiAMs7p8
Assisted-by: Claude Code
Author
Contributor

Tested in game: RTX 4090, Windows 10 Pro 22H2, adult Link in the Lost Woods: ocarina out, ZL held, mouse over the song sheet's icons: the mouse points at the songs on this change (pack s1253 at 4cf1c744) and did not reliably on main (e090cc48); run by hand, rows in docs/tested/

Tested in game: RTX 4090, Windows 10 Pro 22H2, adult Link in the Lost Woods: ocarina out, ZL held, mouse over the song sheet's icons: the mouse points at the songs on this change (pack s1253 at 4cf1c744) and did not reliably on main (e090cc48); run by hand, rows in docs/tested/
Member

Possibly related, for context:

  • PR #1257 fix(input): a mouse button held when one of the game's menus takes the mouse stays pressed — Open overlapping songbook/input behavior fix; RMB variant, related cursor/input logic
Possibly related, for context: - PR #1257 fix(input): a mouse button held when one of the game's menus takes the mouse stays pressed — Open overlapping songbook/input behavior fix; RMB variant, related cursor/input logic
Author
Contributor

The full suite, run before the last two rebases (WSL, python -I -B tests/run_all.py): the same 43 checks fail on this branch and on main at 876dc360 (no clang, Vulkan headers or PIL here), so none comes from this change:

nx2/test_nup_zstd_heads.py test_bug_report_defaults.py test_cpp_preflight.py test_cpu_report.py 
test_crash_record.py test_crt_options.py test_damage_debug_menu.py test_damaged_stand_in_fail_fast.py 
test_dev_packs.py test_discover.py test_display_startup_failure.py test_dlss_feature_size.py 
test_failed_compile_keeps_objects.py test_guest_imported.py test_hud_layout_row.py test_invalidate_quick.py 
test_invalidate_vcore.py test_libc_hooks.py test_lift_lookups.py test_link_skip.py test_linux_pressure.py 
test_linux_update.py test_log_open_failure.py test_longshot_saves.py test_make_game_cache.py 
test_mirror_budget.py test_missing_nup.py test_mods_size_table.py test_pending_guest_import.py 
test_pipeline_play_cache.py test_present_thread.py test_prof_clock.py test_profiling_mode.py 
test_prompt_skip.py test_psychov35_fsr3_fg.py test_readback_timeout_source.py test_run_all_changed.py 
test_scene_tonemap_pass.py test_slow_frames.py test_switch_table.py test_upscaler_rows.py test_walk.py 
test_walk_key.py 

test_check_third_party and test_crt_shaders failed only in my /mnt/c checkout and passed on main in a clean worktree; this PR changes nothing under third_party/. The seven checks that read the changed files were rerun on the rebased branch and pass.

The full suite, run before the last two rebases (WSL, `python -I -B tests/run_all.py`): the same 43 checks fail on this branch and on main at 876dc360 (no clang, Vulkan headers or PIL here), so none comes from this change: ``` nx2/test_nup_zstd_heads.py test_bug_report_defaults.py test_cpp_preflight.py test_cpu_report.py test_crash_record.py test_crt_options.py test_damage_debug_menu.py test_damaged_stand_in_fail_fast.py test_dev_packs.py test_discover.py test_display_startup_failure.py test_dlss_feature_size.py test_failed_compile_keeps_objects.py test_guest_imported.py test_hud_layout_row.py test_invalidate_quick.py test_invalidate_vcore.py test_libc_hooks.py test_lift_lookups.py test_link_skip.py test_linux_pressure.py test_linux_update.py test_log_open_failure.py test_longshot_saves.py test_make_game_cache.py test_mirror_budget.py test_missing_nup.py test_mods_size_table.py test_pending_guest_import.py test_pipeline_play_cache.py test_present_thread.py test_prof_clock.py test_profiling_mode.py test_prompt_skip.py test_psychov35_fsr3_fg.py test_readback_timeout_source.py test_run_all_changed.py test_scene_tonemap_pass.py test_slow_frames.py test_switch_table.py test_upscaler_rows.py test_walk.py test_walk_key.py ``` `test_check_third_party` and `test_crt_shaders` failed only in my `/mnt/c` checkout and passed on main in a clean worktree; this PR changes nothing under `third_party/`. The seven checks that read the changed files were rerun on the rebased branch and pass.
Author
Contributor

@Beanstalk linux: please build the host code of this branch and check that host/nn_hid.c compiles without a new warning and the controls still read (the change is one mask compare in read_input). Any GPU is fine; no game run is needed beyond a start to the title screen.

@Beanstalk linux: please build the host code of this branch and check that host/nn_hid.c compiles without a new warning and the controls still read (the change is one mask compare in read_input). Any GPU is fine; no game run is needed beyond a start to the title screen.
Member

@cuecuemoar only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 708f985, and the PR has changed since (96aac50), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@cuecuemoar only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `708f985`, and the PR has changed since (`96aac50`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
Contributor

The full suite on the rebased branch (708f985e on main 10010630, WSL): 615 passed, 54 failed, 132 skipped, in 51 distinct check files. 49 of them also fail on main at 10010630: 42 of the 43 listed above (test_mirror_budget passed this time) and seven newer ones: test_capture_read_once, test_high_fps_fixes, test_host_guest_writes, test_mise_build, test_prepare_cache_save, test_song_note_cue, test_texture_tile_upload. The other two, test_check_third_party and test_crt_shaders, fail only in my /mnt/c checkout and pass on main in a clean worktree; this PR changes nothing under third_party/.

The full suite on the rebased branch (708f985e on main 10010630, WSL): 615 passed, 54 failed, 132 skipped, in 51 distinct check files. 49 of them also fail on main at 10010630: 42 of the 43 listed above (`test_mirror_budget` passed this time) and seven newer ones: `test_capture_read_once`, `test_high_fps_fixes`, `test_host_guest_writes`, `test_mise_build`, `test_prepare_cache_save`, `test_song_note_cue`, `test_texture_tile_upload`. The other two, `test_check_third_party` and `test_crt_shaders`, fail only in my `/mnt/c` checkout and pass on main in a clean worktree; this PR changes nothing under `third_party/`.
cuecuemoar force-pushed fix/songbook-mouse-hover from 708f985e11
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 22s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 96aac501d1
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 8s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-20 04:40:20 +00:00
Compare
Author
Contributor

Rebased onto main 08994a9e (96 commits since the old base) and force-pushed, 708f985e -> 96aac501 (--force-with-lease on 708f985e).

  • One conflict: README.md. #1802 moved the player docs out of it, so the sentence this PR extended ("the cursor stays hidden while you play on a controller or the keyboard, until the mouse moves") no longer exists, and I kept main's README unchanged. The code and the test are the same as before; the PR no longer touches the README.
  • Linux build, done here (not by the Test Farm): at 96aac501 on Ubuntu 22.04 under WSL2, with the Linux build tools of tools.lock (clang 23.1.5): the renderer builds (scripts/dev.py vk, 0 files failed) and host/nn_hid.c compiles to an object file, with the same 62 -Wall -Wextra warnings as main (none new). Not linked and not run. That is the Host code builds on both Windows and Linux box, now ticked, and "Must be tested" is now None, so the Test Farm request above is no longer needed.
  • Checks on 96aac501: the 29 check files that read nn_hid.c: 27 pass; test_walk_key and test_host_guest_writes fail on main 08994a9e the same way. The full suite is not re-run on this head, so that box is unticked until it is.
  • Not re-run in the game after the rebase (the code is the same as the 4cf1c744 build I tested by hand).
Rebased onto main 08994a9e (96 commits since the old base) and force-pushed, 708f985e -> 96aac501 (`--force-with-lease` on 708f985e). - **One conflict:** `README.md`. #1802 moved the player docs out of it, so the sentence this PR extended ("the cursor stays hidden while you play on a controller or the keyboard, until the mouse moves") no longer exists, and I kept main's README unchanged. The code and the test are the same as before; the PR no longer touches the README. - **Linux build, done here (not by the Test Farm):** at 96aac501 on Ubuntu 22.04 under WSL2, with the Linux build tools of `tools.lock` (clang 23.1.5): the renderer builds (`scripts/dev.py vk`, 0 files failed) and `host/nn_hid.c` compiles to an object file, with the same 62 `-Wall -Wextra` warnings as main (none new). Not linked and not run. That is the *Host code builds on both Windows and Linux* box, now ticked, and "Must be tested" is now None, so the Test Farm request above is no longer needed. - **Checks on 96aac501:** the 29 check files that read `nn_hid.c`: 27 pass; `test_walk_key` and `test_host_guest_writes` fail on main 08994a9e the same way. The full suite is not re-run on this head, so that box is unticked until it is. - Not re-run in the game after the rebase (the code is the same as the 4cf1c744 build I tested by hand).
Author
Contributor

Description moved to the new template, and the suite re-run, with the numbers below. This comment is the list the description points to.

Suite, 2026-11-19 (tests/run_all.py, WSL on Ubuntu 22.04, not --strict, 32 at once): PR head 96aac501 and its base, main 08994a9e, one after the other: 787 passed, 66 failed, 18 skipped on both. The same 65 check files fail on both (the runner counts 66 failures; its table lists these 65 files). This PR adds none and fixes none. One check is skipped here (dav1d is not installed), which --strict would fail.

The 65 files:

nx2/test_coop_spirv.py
tests/test_appimage_player_build.py
tests/test_bug_report_defaults.py
tests/test_capture_read_once.py
tests/test_capture_readback_visibility.py
tests/test_cpp_preflight.py
tests/test_crash_dialog.py
tests/test_crash_record.py
tests/test_crt_options.py
tests/test_damage_debug_menu.py
tests/test_dev_ab.py
tests/test_dev_packs.py
tests/test_display_startup_failure.py
tests/test_dlss_actor.py
tests/test_dlss_feature_size.py
tests/test_draw_stream_visibility.py
tests/test_failed_compile_keeps_objects.py
tests/test_frame_overlap.py
tests/test_fsr3_math.py
tests/test_fsr3_shaders.py
tests/test_fsr3fi_hud_layer.py
tests/test_fsr3fi_hudless_colour.py
tests/test_fsr_image_retirement.py
tests/test_fsr_uniform_ownership.py
tests/test_guest_imported.py
tests/test_high_fps_fixes.py
tests/test_host_guest_writes.py
tests/test_hud_layout_row.py
tests/test_late_fix_shaders.py
tests/test_libc_hooks.py
tests/test_lift_cache.py
tests/test_linux_preflight.py
tests/test_linux_pressure.py
tests/test_linux_tools.py
tests/test_linux_update.py
tests/test_log_open_failure.py
tests/test_make_game_ngx.py
tests/test_mesh_unreachable_outputs.py
tests/test_mise_build.py
tests/test_missing_nup.py
tests/test_mods_list.py
tests/test_mods_size_table.py
tests/test_ngx_sdk.py
tests/test_nonuniform_image_arrays.py
tests/test_parallel_init_order.py
tests/test_pending_guest_import.py
tests/test_pipeline_play_cache.py
tests/test_prepare_cache_save.py
tests/test_present_queue_default.py
tests/test_present_source_crop.py
tests/test_present_thread.py
tests/test_prof_clock.py
tests/test_profiling_mode.py
tests/test_psychov35_fsr3_fg.py
tests/test_reactive_mask.py
tests/test_readback_timeout_source.py
tests/test_replay_write_order.py
tests/test_slow_frames.py
tests/test_song_note_cue.py
tests/test_staging_burst.py
tests/test_texel_buffer_ownership.py
tests/test_upscaler_rows.py
tests/test_vcore_escape.py
tests/test_vk_occlusion_queries.py
tests/test_walk_key.py

Where I looked at the causes (from the failure output, not every test), they are of two kinds, neither this change's: tests that cut code out of the source and no longer find it because main's source moved (for example srccut: 'uint32_t memory_page_stamp(' is not in gpu/vk/vk_memory.cpp, undeclared identifier 'host_read_barrier', too many arguments to function 'scripted_input'), and checks that regenerate SPIR-V or validate it with glslang 11.8 and spirv-tools 2022.1, which Ubuntu 22.04 ships and the repository's pins are newer than (Invalid capability operand: 6022, *_spv.h is not made from ... as it is now).

The only new thing this run changed in the description: One topic, on current main is unticked, because main has moved one commit since the rebase (3f2c9b3c, a test-only change to the NFC menu, no file in common with this PR). I will rebase right before pr ready.

Description moved to the new template, and the suite re-run, with the numbers below. This comment is the list the description points to. **Suite, 2026-11-19** (`tests/run_all.py`, WSL on Ubuntu 22.04, not `--strict`, 32 at once): PR head 96aac501 and its base, main 08994a9e, one after the other: **787 passed, 66 failed, 18 skipped on both**. The same 65 check files fail on both (the runner counts 66 failures; its table lists these 65 files). This PR adds none and fixes none. One check is skipped here (dav1d is not installed), which `--strict` would fail. The 65 files: ``` nx2/test_coop_spirv.py tests/test_appimage_player_build.py tests/test_bug_report_defaults.py tests/test_capture_read_once.py tests/test_capture_readback_visibility.py tests/test_cpp_preflight.py tests/test_crash_dialog.py tests/test_crash_record.py tests/test_crt_options.py tests/test_damage_debug_menu.py tests/test_dev_ab.py tests/test_dev_packs.py tests/test_display_startup_failure.py tests/test_dlss_actor.py tests/test_dlss_feature_size.py tests/test_draw_stream_visibility.py tests/test_failed_compile_keeps_objects.py tests/test_frame_overlap.py tests/test_fsr3_math.py tests/test_fsr3_shaders.py tests/test_fsr3fi_hud_layer.py tests/test_fsr3fi_hudless_colour.py tests/test_fsr_image_retirement.py tests/test_fsr_uniform_ownership.py tests/test_guest_imported.py tests/test_high_fps_fixes.py tests/test_host_guest_writes.py tests/test_hud_layout_row.py tests/test_late_fix_shaders.py tests/test_libc_hooks.py tests/test_lift_cache.py tests/test_linux_preflight.py tests/test_linux_pressure.py tests/test_linux_tools.py tests/test_linux_update.py tests/test_log_open_failure.py tests/test_make_game_ngx.py tests/test_mesh_unreachable_outputs.py tests/test_mise_build.py tests/test_missing_nup.py tests/test_mods_list.py tests/test_mods_size_table.py tests/test_ngx_sdk.py tests/test_nonuniform_image_arrays.py tests/test_parallel_init_order.py tests/test_pending_guest_import.py tests/test_pipeline_play_cache.py tests/test_prepare_cache_save.py tests/test_present_queue_default.py tests/test_present_source_crop.py tests/test_present_thread.py tests/test_prof_clock.py tests/test_profiling_mode.py tests/test_psychov35_fsr3_fg.py tests/test_reactive_mask.py tests/test_readback_timeout_source.py tests/test_replay_write_order.py tests/test_slow_frames.py tests/test_song_note_cue.py tests/test_staging_burst.py tests/test_texel_buffer_ownership.py tests/test_upscaler_rows.py tests/test_vcore_escape.py tests/test_vk_occlusion_queries.py tests/test_walk_key.py ``` Where I looked at the causes (from the failure output, not every test), they are of two kinds, neither this change's: tests that cut code out of the source and no longer find it because main's source moved (for example `srccut: 'uint32_t memory_page_stamp(' is not in gpu/vk/vk_memory.cpp`, `undeclared identifier 'host_read_barrier'`, `too many arguments to function 'scripted_input'`), and checks that regenerate SPIR-V or validate it with glslang 11.8 and spirv-tools 2022.1, which Ubuntu 22.04 ships and the repository's pins are newer than (`Invalid capability operand: 6022`, `*_spv.h is not made from ... as it is now`). The only new thing this run changed in the description: *One topic, on current `main`* is unticked, because main has moved one commit since the rebase (`3f2c9b3c`, a test-only change to the NFC menu, no file in common with this PR). I will rebase right before `pr ready`.
cuecuemoar force-pushed fix/songbook-mouse-hover from 96aac501d1
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 8s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 5eaa02e5ed
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 20s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-20 16:02:56 +00:00
Compare
cuecuemoar force-pushed fix/songbook-mouse-hover from 5eaa02e5ed
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 20s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to c07b01368a
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 17s
beanstalk/approval changed since the request: ask again
2026-11-20 16:27:06 +00:00
Compare
Author
Contributor

Rebased onto main 2210931c and force-pushed (--force-with-lease), 96aac501 -> c07b0136; the description is current for that head. What changed since the last comment:

  • The docs(tested) commit is dropped. #1856 removed docs/tested/ from main ("no longer asks for" run files since #1802), so adding two run files back would re-create a folder main deleted. The by-hand runs are in Testing and Measurements now. The PR is two commits: the test and the fix.
  • Suite, on the exact commits (tests/run_all.py, WSL on Ubuntu 22.04, not --strict, 32 at once): PR head 5eaa02e5: 795 passed, 69 failed, 18 skipped; its base, main 6d25da8c: 794 passed, 70 failed, 18 skipped. No check fails only on the PR head. The same 68 check files fail on both; main also failed test_longshot_ctl in that run, which is flaky under load (3 of 3 passes alone on both commits). One check is skipped here (dav1d is not installed), which --strict would fail.
  • After the last rebase (one more main commit, 2210931c, host/nn_os_sync.c plus a switch row and its test, nothing nn_hid.c includes) at c07b0136: the renderer builds (scripts/dev.py vk, 0 files failed), host/nn_hid.c compiles with the same 62 -Wall -Wextra warnings as main, the 29 check files that read it give 27 passes and the same two failures as main (test_walk_key, test_host_guest_writes), and held-input fails on main + the test commit (FAIL:305 player_stamps == 1) and passes here. Not the whole suite again.

The 68 files that fail on both:

nx2/test_coop_spirv.py
tests/test_appimage_player_build.py
tests/test_bug_report_defaults.py
tests/test_capture_read_once.py
tests/test_capture_readback_visibility.py
tests/test_cpp_preflight.py
tests/test_crash_dialog.py
tests/test_crash_record.py
tests/test_crt_options.py
tests/test_damage_debug_menu.py
tests/test_dev_ab.py
tests/test_dev_packs.py
tests/test_display_startup_failure.py
tests/test_dlss_actor.py
tests/test_dlss_feature_size.py
tests/test_draw_binds.py
tests/test_draw_stream_visibility.py
tests/test_failed_compile_keeps_objects.py
tests/test_frame_overlap.py
tests/test_fsr3_math.py
tests/test_fsr3_shaders.py
tests/test_fsr3fi_hud_layer.py
tests/test_fsr3fi_hudless_colour.py
tests/test_fsr_image_retirement.py
tests/test_fsr_uniform_ownership.py
tests/test_guest_imported.py
tests/test_high_fps_fixes.py
tests/test_host_guest_writes.py
tests/test_hud_layout_row.py
tests/test_late_fix_shaders.py
tests/test_libc_hooks.py
tests/test_lift_cache.py
tests/test_linux_preflight.py
tests/test_linux_pressure.py
tests/test_linux_tools.py
tests/test_linux_update.py
tests/test_log_open_failure.py
tests/test_low_vram_texture_mips.py
tests/test_make_game_ngx.py
tests/test_mesh_unreachable_outputs.py
tests/test_mise_build.py
tests/test_missing_nup.py
tests/test_mods_list.py
tests/test_mods_size_table.py
tests/test_ngx_sdk.py
tests/test_nonuniform_image_arrays.py
tests/test_pass_barrier.py
tests/test_pending_guest_import.py
tests/test_pipeline_play_cache.py
tests/test_prepare_cache_save.py
tests/test_present_queue_default.py
tests/test_present_source_crop.py
tests/test_prof_clock.py
tests/test_profiling_mode.py
tests/test_psychov35_fsr3_fg.py
tests/test_reactive_mask.py
tests/test_readback_timeout_source.py
tests/test_replay_write_order.py
tests/test_sampler_admission.py
tests/test_slow_frames.py
tests/test_song_note_cue.py
tests/test_staging_burst.py
tests/test_texel_buffer_ownership.py
tests/test_ub_update_batch.py
tests/test_upscaler_rows.py
tests/test_vcore_escape.py
tests/test_vk_occlusion_queries.py
tests/test_walk_key.py

From the failure output (not every test): tests that cut code out of main's source and no longer find it, and checks that regenerate or validate SPIR-V with the glslang 11.8 and spirv-tools 2022.1 of Ubuntu 22.04, older than the repository's pins. Neither is this change's.

Rebased onto main 2210931c and force-pushed (`--force-with-lease`), 96aac501 -> c07b0136; the description is current for that head. What changed since the last comment: - **The `docs(tested)` commit is dropped.** #1856 removed `docs/tested/` from main ("no longer asks for" run files since #1802), so adding two run files back would re-create a folder main deleted. The by-hand runs are in Testing and Measurements now. The PR is two commits: the test and the fix. - **Suite, on the exact commits** (`tests/run_all.py`, WSL on Ubuntu 22.04, not `--strict`, 32 at once): PR head 5eaa02e5: **795 passed, 69 failed, 18 skipped**; its base, main 6d25da8c: 794 passed, 70 failed, 18 skipped. No check fails only on the PR head. The same 68 check files fail on both; main also failed `test_longshot_ctl` in that run, which is flaky under load (3 of 3 passes alone on both commits). One check is skipped here (dav1d is not installed), which `--strict` would fail. - **After the last rebase** (one more main commit, 2210931c, `host/nn_os_sync.c` plus a switch row and its test, nothing `nn_hid.c` includes) at c07b0136: the renderer builds (`scripts/dev.py vk`, 0 files failed), `host/nn_hid.c` compiles with the same 62 `-Wall -Wextra` warnings as main, the 29 check files that read it give 27 passes and the same two failures as main (`test_walk_key`, `test_host_guest_writes`), and `held-input` fails on main + the test commit (`FAIL:305 player_stamps == 1`) and passes here. Not the whole suite again. The 68 files that fail on both: ``` nx2/test_coop_spirv.py tests/test_appimage_player_build.py tests/test_bug_report_defaults.py tests/test_capture_read_once.py tests/test_capture_readback_visibility.py tests/test_cpp_preflight.py tests/test_crash_dialog.py tests/test_crash_record.py tests/test_crt_options.py tests/test_damage_debug_menu.py tests/test_dev_ab.py tests/test_dev_packs.py tests/test_display_startup_failure.py tests/test_dlss_actor.py tests/test_dlss_feature_size.py tests/test_draw_binds.py tests/test_draw_stream_visibility.py tests/test_failed_compile_keeps_objects.py tests/test_frame_overlap.py tests/test_fsr3_math.py tests/test_fsr3_shaders.py tests/test_fsr3fi_hud_layer.py tests/test_fsr3fi_hudless_colour.py tests/test_fsr_image_retirement.py tests/test_fsr_uniform_ownership.py tests/test_guest_imported.py tests/test_high_fps_fixes.py tests/test_host_guest_writes.py tests/test_hud_layout_row.py tests/test_late_fix_shaders.py tests/test_libc_hooks.py tests/test_lift_cache.py tests/test_linux_preflight.py tests/test_linux_pressure.py tests/test_linux_tools.py tests/test_linux_update.py tests/test_log_open_failure.py tests/test_low_vram_texture_mips.py tests/test_make_game_ngx.py tests/test_mesh_unreachable_outputs.py tests/test_mise_build.py tests/test_missing_nup.py tests/test_mods_list.py tests/test_mods_size_table.py tests/test_ngx_sdk.py tests/test_nonuniform_image_arrays.py tests/test_pass_barrier.py tests/test_pending_guest_import.py tests/test_pipeline_play_cache.py tests/test_prepare_cache_save.py tests/test_present_queue_default.py tests/test_present_source_crop.py tests/test_prof_clock.py tests/test_profiling_mode.py tests/test_psychov35_fsr3_fg.py tests/test_reactive_mask.py tests/test_readback_timeout_source.py tests/test_replay_write_order.py tests/test_sampler_admission.py tests/test_slow_frames.py tests/test_song_note_cue.py tests/test_staging_burst.py tests/test_texel_buffer_ownership.py tests/test_ub_update_batch.py tests/test_upscaler_rows.py tests/test_vcore_escape.py tests/test_vk_occlusion_queries.py tests/test_walk_key.py ``` From the failure output (not every test): tests that cut code out of main's source and no longer find it, and checks that regenerate or validate SPIR-V with the glslang 11.8 and spirv-tools 2022.1 of Ubuntu 22.04, older than the repository's pins. Neither is this change's.
cuecuemoar changed title from WIP: fix(input): the mouse points at the ocarina song sheet's songs while ZL is held (#1253) to fix(input): the mouse points at the ocarina song sheet's songs while ZL is held (#1253) 2026-11-20 16:29:04 +00:00
HumanBean left a comment

Recommendation: Approve. It fixes the mouse's hover on the ocarina's song sheet while ZL is held on a pad or the Z key: the held button no longer re-hides the cursor at every read. It costs nothing, and the only thing that reads the stamp is the game menus' cursor. Recommend approval; not approved on the forge.

For a player: with the ocarina out and ZL held on a controller or the Z key, moving the mouse over the songs now selects them. The code gets better: one edge check (down & ~down_was) in place of a stamp on every read, so a press still hides the cursor and a held button no longer does.

Does it help: not a perf change. The fix is shown by the game-free held-input case (fails on main + the test commit with FAIL:305 player_stamps == 1, passes here) and by the author's run by hand on Windows 10 / RTX 4090 (the build at 4cf1c744, the same code before two rebases).
Other systems: player_input_ns has one reader, host/display.c gm_cursor_shown (the free cursor in play and in the game's menus), so nothing else can change. A controller player whose mouse is bumped past the slack while they hold a button now keeps the cursor shown until the next press or stick tilt, where it used to hide again at once. That is the intended change and does no harm. The sticks (past 12000) and the movement and camera keys still stamp at every read. Mouse buttons never stamped and still don't. Scripted and bridge presses go into *buttons above pb and never stamped. Linux and the Steam Deck run the same C on the same masks (pads_read's pb, bound_down through host/posix/windows.h), so the platform can't make it behave differently. It is built on Linux and not run there.
Switches: none.

Reviewed: c07b01368a against main 2210931cf2 (its base; it is still mergeable on main 3df5c13ed2). Read in full: read_input in host/nn_hid.c, player_used and hos_player_input_ns, gm_cursor_shown/gm_mouse_used in host/display.c, tests/input_background_test.c's new case, and the changes to tests/test_input_background.py and tests/test_pads_after_menu.py. The suite numbers in the comments were only skimmed. Nothing was run, since this is a code review.
Fixed in this review: nothing.
Checked and fine:

  • down holds the pads' buttons (pb) and the bound keys (bound_down(i, 0)) in the same HidNpadButton bit layout that *buttons uses.
  • With the Insert menu open, a pad press still stamps, as on main (pb is read whatever the menu state). Keys read as up there (key()).
  • The early returns (window behind, HOS_INPUT_EXCLUSIVE) leave down_was as it was. At worst a press made right after the game comes back to the front is not stamped, which leaves the cursor shown. That is harmless and never causes a hide.
  • down_was is one more static like menu_was beside it, read and written only on the input thread.
  • The test runs the real read_input with the real player_used call sites. It counts stamps for a key and for a pad button going down, held for five reads, let go, pressed again, and a second button pressed while the first is held. Undo the key line (stamp at every read) and it fails.
  • test_pads_after_menu.py's cut gets a local down and asserts nothing new, so the check is not weakened.

Suggestions (the author may take or leave)

  • host/display.c lines 79-80 (outside this diff) give, as the wheel's reason for not showing the cursor, that "a button held (R, for the item choice) counts as the pad in use, and hid the cursor again at each notch". After this PR a held button no longer counts, so that reason is out of date. A word there (for example "counted", or the reason that holds now) would stop it misleading the next reader.
  • The comment above player_input_ns (host/nn_hid.c ~155) says "the last time the player's pads (a button, ...) or bound keys were used". "A button or bound key pressed" would match the new rule.

Testing: By hand on Windows 10 Pro 22H2, RTX 4090, by the author, on the same code before two rebases. The game-free case fails on main and passes here. The checks that read nn_hid.c pass, apart from two that fail the same way on main. On Linux it is built (renderer, plus nn_hid.c compiled with no new warnings) and not run. The game can't plausibly behave differently on Linux, so the missing Linux run doesn't hold the merge. The forge's CI hasn't run on this head yet (it is waiting on its required conditions).
Overlaps and merge order: #1257 is by the same author in host/nn_hid.c: the right mouse button (ZL) held on the same song sheet stays pressed, fixing #1130. The two are independent, and neither needs the other:

  • This PR stamps only the pads' buttons and the keys, never a mouse button. That PR changes only the mouse buttons' arming and their loop further down read_input, which doesn't stamp.
  • Their hunks don't overlap in nn_hid.c, input_background_test.c or test_input_background.py.
  • That PR is not mergeable as it is: it conflicts with main on the README (#1802 moved the player docs) and on docs/tested/ (removed in #1856).

Merge this one first. #1257 then rebases onto main with it.

**Recommendation: Approve.** It fixes the mouse's hover on the ocarina's song sheet while ZL is held on a pad or the Z key: the held button no longer re-hides the cursor at every read. It costs nothing, and the only thing that reads the stamp is the game menus' cursor. Recommend approval; not approved on the forge. For a player: with the ocarina out and ZL held on a controller or the Z key, moving the mouse over the songs now selects them. The code gets better: one edge check (`down & ~down_was`) in place of a stamp on every read, so a press still hides the cursor and a held button no longer does. **Does it help:** not a perf change. The fix is shown by the game-free `held-input` case (fails on main + the test commit with `FAIL:305 player_stamps == 1`, passes here) and by the author's run by hand on Windows 10 / RTX 4090 (the build at 4cf1c744, the same code before two rebases). **Other systems:** `player_input_ns` has one reader, `host/display.c` `gm_cursor_shown` (the free cursor in play and in the game's menus), so nothing else can change. A controller player whose mouse is bumped past the slack while they hold a button now keeps the cursor shown until the next press or stick tilt, where it used to hide again at once. That is the intended change and does no harm. The sticks (past 12000) and the movement and camera keys still stamp at every read. Mouse buttons never stamped and still don't. Scripted and bridge presses go into `*buttons` above `pb` and never stamped. Linux and the Steam Deck run the same C on the same masks (`pads_read`'s `pb`, `bound_down` through `host/posix/windows.h`), so the platform can't make it behave differently. It is built on Linux and not run there. **Switches:** none. **Reviewed:** c07b01368a against main 2210931cf2 (its base; it is still mergeable on main 3df5c13ed2). Read in full: `read_input` in `host/nn_hid.c`, `player_used` and `hos_player_input_ns`, `gm_cursor_shown`/`gm_mouse_used` in `host/display.c`, `tests/input_background_test.c`'s new case, and the changes to `tests/test_input_background.py` and `tests/test_pads_after_menu.py`. The suite numbers in the comments were only skimmed. Nothing was run, since this is a code review. **Fixed in this review:** nothing. **Checked and fine:** - `down` holds the pads' buttons (`pb`) and the bound keys (`bound_down(i, 0)`) in the same HidNpadButton bit layout that `*buttons` uses. - With the Insert menu open, a pad press still stamps, as on main (`pb` is read whatever the menu state). Keys read as up there (`key()`). - The early returns (window behind, `HOS_INPUT_EXCLUSIVE`) leave `down_was` as it was. At worst a press made right after the game comes back to the front is not stamped, which leaves the cursor shown. That is harmless and never causes a hide. - `down_was` is one more `static` like `menu_was` beside it, read and written only on the input thread. - The test runs the real `read_input` with the real `player_used` call sites. It counts stamps for a key and for a pad button going down, held for five reads, let go, pressed again, and a second button pressed while the first is held. Undo the key line (stamp at every read) and it fails. - `test_pads_after_menu.py`'s cut gets a local `down` and asserts nothing new, so the check is not weakened. **Suggestions** (the author may take or leave) - `host/display.c` lines 79-80 (outside this diff) give, as the wheel's reason for not showing the cursor, that "a button held (R, for the item choice) counts as the pad in use, and hid the cursor again at each notch". After this PR a held button no longer counts, so that reason is out of date. A word there (for example "counted", or the reason that holds now) would stop it misleading the next reader. - The comment above `player_input_ns` (`host/nn_hid.c` ~155) says "the last time the player's pads (a button, ...) or bound keys were used". "A button or bound key pressed" would match the new rule. **Testing:** By hand on Windows 10 Pro 22H2, RTX 4090, by the author, on the same code before two rebases. The game-free case fails on main and passes here. The checks that read `nn_hid.c` pass, apart from two that fail the same way on main. On Linux it is built (renderer, plus `nn_hid.c` compiled with no new warnings) and not run. The game can't plausibly behave differently on Linux, so the missing Linux run doesn't hold the merge. The forge's CI hasn't run on this head yet (it is waiting on its required conditions). **Overlaps and merge order:** [#1257](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1257) is by the same author in `host/nn_hid.c`: the right mouse button (ZL) held on the same song sheet stays pressed, fixing #1130. The two are independent, and neither needs the other: - This PR stamps only the pads' buttons and the keys, never a mouse button. That PR changes only the mouse buttons' arming and their loop further down `read_input`, which doesn't stamp. - Their hunks don't overlap in `nn_hid.c`, `input_background_test.c` or `test_input_background.py`. - That PR is not mergeable as it is: it conflicts with main on the README (#1802 moved the player docs) and on `docs/tested/` (removed in #1856). Merge this one first. [#1257](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1257) then rebases onto main with it.
@ -1089,0 +1092,4 @@
ZL is for the ocarina's song sheet, it kept the game menus' cursor hidden, which the mouse shows by moving: Longshot
#1253) */
static uint64_t down_was;
if (down & ~down_was) player_used();
Owner

Checked: the edge stamp is right. Only display.c's gm_cursor_shown reads player_input_ns, a press still hides the cursor, the sticks and the movement keys still stamp at every read, and an early return that leaves down_was stale can only miss a stamp (cursor left shown), never add one.

Checked: the edge stamp is right. Only display.c's gm_cursor_shown reads player_input_ns, a press still hides the cursor, the sticks and the movement keys still stamp at every read, and an early return that leaves down_was stale can only miss a stamp (cursor left shown), never add one.
HumanBean deleted branch fix/songbook-mouse-hover 2026-11-20 22:57:04 +00:00
Author
Contributor

Correction to my description and to my comment of 2026-11-20: I wrote that docs/tested/ is "gone from main" and that I dropped the docs(tested) commit because main deleted the folder. That was too strong. #1802 stopped asking for run files and #1856 removed the one file left at that moment, but main has run files there again, added by PRs merged since. Dropping this PR's two run files was still allowed (they are no longer asked for), and the by-hand runs are in Testing and Measurements; the description now says that. The squashed commit message (83df631b) keeps my first wording; the code merged is the verified c07b0136.

Correction to my description and to my comment of 2026-11-20: I wrote that `docs/tested/` is "gone from main" and that I dropped the `docs(tested)` commit because main deleted the folder. That was too strong. #1802 stopped asking for run files and #1856 removed the one file left at that moment, but main has run files there again, added by PRs merged since. Dropping this PR's two run files was still allowed (they are no longer asked for), and the by-hand runs are in Testing and Measurements; the description now says that. The squashed commit message (83df631b) keeps my first wording; the code merged is the verified c07b0136.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 17s
beanstalk/approval changed since the request: ask again
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1640
No description provided.