fix(input): the left stick moves the Insert menu as the D-pad does #3307

Open
fofuxo wants to merge 2 commits from fofuxo/Longshot:fix/menu-left-stick into main
Contributor

Summary

On a controller, the Insert menu moved only on the D-pad: the left stick did nothing there, while the game's own menus
follow it. To see it on main: open the Insert menu with a controller and push the left stick; the focus stays put.

With this PR the left stick moves the Insert menu as the D-pad does: one step a push, repeated while held, in every tab
and page. It does so only while the menu is open: in play the stick walks Link, and a mod's debug page shown beside the
game does not move with him. A stick already pushed as the menu opens (Link walking) moves nothing until it is let go
and pushed again, as the D-pad held through the opening. No control can be bound to it, so the game and the Controls page never see it.

  • host/nn_hid.c pad_left_stick_way: pads_read adds the left stick pushed one way to the pads' inputs as bits of
    their own past HOS_PAD_N (HOS_PAD_LS_*, gpu/vk/vk_api.h), as the right stick's for the ocarina already are: the
    way it leans most once past half its travel, held until that axis comes back under 30 percent, so a stick resting
    near the line, or turning toward a diagonal, does not press again.
  • gpu/vk/vk_ui_keys.h pad_ways: the D-pad and those bits as the menu's four moves, the stick's only while the menu
    is open; PadWays keeps every way held across presents, the stick's too, so one pushed as the menu opens is no press;
    gpu/vk/vk_ui.cpp moves and repeats on them as it did on the D-pad.

Every controller reaches pads_read, the builder's too (the Switch 2 Pro Controller's driver, the Joy-Cons through
SDL), so one place covers them all.

The stick's reading is dyst's stick_dirs from #2421, which
carries this fix beside its Progress page but cannot land as it is: the menu it read for (gpu/vk/vk_menu.cpp) has since
left the renderer. dyst is a co-author of both commits. #2421's other menu fix (the movement keys moving the menu) is
not taken: main repeats W, A, S and D in the menu already.

Read first: host/nn_hid.c pad_left_stick_way, then gpu/vk/vk_ui_keys.h pad_ways and PadWays.

Testing

Tested: Windows 11 (build 26300), NVIDIA GeForce RTX 3070 (driver 621.47), this checkout's runtime (dev.py rt)
over the shared base. In the game, by hand, with each controller: a Switch 2 Pro Controller over USB (the builder's
driver), a DualShock 4, and four Joy-Cons. With each, the left stick moved the Insert menu through its tabs and rows as
the D-pad does, repeated when held, and did not move it from a stick at rest or slightly tilted; the menu closed, the
stick walked Link as before; on the Controls page a binding that waited for a button did not take the stick. After the
review's L1 (head db4185d2), again in the game: with Link walking, the menu opened with the stick still pushed
selected and moved nothing; let go and pushed again, it moved; closing it and playing were as before. Both runs closed
cleanly, with no fatal or device-lost line. dev.py smoke: PASS (in play from kokiri-start, 900 frames, the
menu opened).
At e01c8444 (on main @ 6c06d981, so with #3244's Bluetooth), again in the game by hand: a Switch 2 Pro Controller
over Bluetooth, no cable plugged in. The left stick moved the Insert menu as over USB, held or not, opening the menu
with the stick pushed moved nothing, and the stick walked Link once the menu closed; the game closed with exit status 0.
That run's log was not kept (only its last lines), so the link is the player's word, not a log line.

Checks:

  • tests/test_menu_left_stick.py (new) fails on main (the test's commit alone) and passes here, with gcc and g++,
    with clang and clang++, and with CC/CXX set. With the fix's key lines undone one at a time (the stick in
    pad_ways, the hold, the half-way threshold, PadWays keeping the stick held as the menu opens) it fails each time.
  • At e01c8444 (the review's fixes, rebased on main @ 6c06d981), as at db4185d2 before the rebase,
    tests/run_all.py --strict --changed origin/main: 79 passed, 2 failed, 6
    skipped; the two are test_fps_stats and test_gfx_effects, which fail on main too (below).
  • At d387b2be (before the review), tests/run_all.py --strict (the whole suite, as mise run test; Windows, mise's Python 3.12.15, llvm-mingw's clang
    first on PATH, CC=gcc): 876 passed, 26 failed, 55 skipped. 25 of the 26 fail on main @ be494221 too, run again
    there by name: test_audio_output_errors, test_audio_wave_buffer_release, test_device_lost_exit,
    test_fixed_share_upscale_shader, test_fps_stats, test_framegen_hdr, test_fsr3fi_hud_layer,
    test_fsr3fi_hudless_colour, test_fsr4_tune, test_game_font, test_gfx_effects, test_helpers_extract,
    test_lifter, test_longshot_builder, test_lost_wait_said, test_obj_cache_size, test_present_acquire_ahead,
    test_present_device_loss, test_present_probe, test_present_probe_retirement, test_present_thread,
    test_queue_priority, test_rt_refl_lamps, test_submit_oom, test_temporal_present_bandwidth. The 26th,
    test_fsr4_own_cache, said PASS and then failed in its cache's clean-up under the full run's load; alone it passes
    here twice, as on main. Two of them read a file this changes and fail on main for the same reason: test_fps_stats (a marker
    main's source no longer has) and test_gfx_effects (no glslang under that name: run_all.py looks for
    glslangValidator, tools.lock ships glslang.exe).

Still to test:

  • Linux, any controller: the left stick in the Insert menu, expecting it to move the menu as on Windows (@Beanstalk a
    Linux run: open the Insert menu with a controller and move through its tabs with the left stick).

Measurements

Verdict: fixed: the left stick moves the Insert menu here and does not on main. Nothing to measure for speed: the
change adds a few comparisons to each read of the pads (every 2 ms at most) and to each present while a page is hosted. Measured on main @ be494221; rebased since on 6c06d981, which changes none of this PR's code, so the
result still holds.

Setup: Windows 11 (build 26300), RTX 3070 (NVIDIA 621.47); the game-free check, and the Insert menu in the game with a
Switch 2 Pro Controller over USB, a DualShock 4 and Joy-Cons.

Before: main @ be494221 After: this PR @ db4185d2
tests/test_menu_left_stick.py fails: no left stick direction for the menu passes (gcc, g++, clang, clang++)
The left stick in the Insert menu the focus stays put moves like the D-pad, repeats when held
The left stick with the menu closed walks Link walks Link
The menu opened with the stick already pushed nothing moves nothing moves until let go and pushed again

Risks

  • Every controller player's Insert menu: the left stick now moves it. A worn stick that rests past half its travel
    would move the menu on its own; past the dead zone, the game would walk Link on its own too, and the Stick dead zone
    row covers both.
  • The game's input is untouched: the new bits are past HOS_PAD_N, where no control can be bound (the binds take 0
    to HOS_PAD_N - 1), and the game's buttons are read through the binds.
  • Turning it off: a revert. Nothing changes after updating: saves and settings are untouched.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • 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). (Testing names them.)
  • 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. (None needed updating: every check that
    reads the changed files passes, but those named under Testing, which fail on main too.)
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Built on Windows with llvm-mingw, dev.py rt. On Linux, from the diff: host/nn_hid.c gains pad_left_stick_way, plain C on int32_t and uint64_t that the
    new check compiles, and one line in pads_read reading pad_raw_now as hos_pad_raw already does on Linux; the
    HOS_PAD_LS_* bits are vk_api.h's, which CI's Linux renderer build compiles. No path handling changes. The Linux
    run itself is in Still to test, asked of the Test Farm.)
  • Docs updated. (docs/user/graphics-and-controls.md: the D-pad or the left stick chooses; docs/dev/reference/ui-draw-list.md: nav.)
  • 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.

🤖 Generated with Claude Code

## Summary On a controller, the Insert menu moved only on the D-pad: the left stick did nothing there, while the game's own menus follow it. To see it on `main`: open the Insert menu with a controller and push the left stick; the focus stays put. With this PR the left stick moves the Insert menu as the D-pad does: one step a push, repeated while held, in every tab and page. It does so only while the menu is open: in play the stick walks Link, and a mod's debug page shown beside the game does not move with him. A stick already pushed as the menu opens (Link walking) moves nothing until it is let go and pushed again, as the D-pad held through the opening. No control can be bound to it, so the game and the Controls page never see it. - `host/nn_hid.c` `pad_left_stick_way`: `pads_read` adds the left stick pushed one way to the pads' inputs as bits of their own past `HOS_PAD_N` (`HOS_PAD_LS_*`, `gpu/vk/vk_api.h`), as the right stick's for the ocarina already are: the way it leans most once past half its travel, held until that axis comes back under 30 percent, so a stick resting near the line, or turning toward a diagonal, does not press again. - `gpu/vk/vk_ui_keys.h` `pad_ways`: the D-pad and those bits as the menu's four moves, the stick's only while the menu is open; `PadWays` keeps every way held across presents, the stick's too, so one pushed as the menu opens is no press; `gpu/vk/vk_ui.cpp` moves and repeats on them as it did on the D-pad. Every controller reaches `pads_read`, the builder's too (the Switch 2 Pro Controller's driver, the Joy-Cons through SDL), so one place covers them all. The stick's reading is dyst's `stick_dirs` from https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2421, which carries this fix beside its Progress page but cannot land as it is: the menu it read for (`gpu/vk/vk_menu.cpp`) has since left the renderer. dyst is a co-author of both commits. #2421's other menu fix (the movement keys moving the menu) is not taken: `main` repeats W, A, S and D in the menu already. Read first: `host/nn_hid.c` `pad_left_stick_way`, then `gpu/vk/vk_ui_keys.h` `pad_ways` and `PadWays`. ## Testing **Tested:** Windows 11 (build 26300), NVIDIA GeForce RTX 3070 (driver 621.47), this checkout's runtime (`dev.py rt`) over the shared base. In the game, by hand, with each controller: a Switch 2 Pro Controller over USB (the builder's driver), a DualShock 4, and four Joy-Cons. With each, the left stick moved the Insert menu through its tabs and rows as the D-pad does, repeated when held, and did not move it from a stick at rest or slightly tilted; the menu closed, the stick walked Link as before; on the Controls page a binding that waited for a button did not take the stick. After the review's L1 (head `db4185d2`), again in the game: with Link walking, the menu opened with the stick still pushed selected and moved nothing; let go and pushed again, it moved; closing it and playing were as before. Both runs closed cleanly, with no fatal or device-lost line. `dev.py smoke`: PASS (in play from `kokiri-start`, 900 frames, the menu opened). At `e01c8444` (on `main` @ 6c06d981, so with #3244's Bluetooth), again in the game by hand: a Switch 2 Pro Controller over Bluetooth, no cable plugged in. The left stick moved the Insert menu as over USB, held or not, opening the menu with the stick pushed moved nothing, and the stick walked Link once the menu closed; the game closed with exit status 0. That run's log was not kept (only its last lines), so the link is the player's word, not a log line. Checks: - `tests/test_menu_left_stick.py` (new) fails on `main` (the test's commit alone) and passes here, with gcc and g++, with clang and clang++, and with `CC`/`CXX` set. With the fix's key lines undone one at a time (the stick in `pad_ways`, the hold, the half-way threshold, `PadWays` keeping the stick held as the menu opens) it fails each time. - At `e01c8444` (the review's fixes, rebased on `main` @ 6c06d981), as at `db4185d2` before the rebase, `tests/run_all.py --strict --changed origin/main`: 79 passed, 2 failed, 6 skipped; the two are `test_fps_stats` and `test_gfx_effects`, which fail on `main` too (below). - At `d387b2be` (before the review), `tests/run_all.py --strict` (the whole suite, as `mise run test`; Windows, mise's Python 3.12.15, llvm-mingw's clang first on `PATH`, `CC=gcc`): 876 passed, 26 failed, 55 skipped. 25 of the 26 fail on `main` @ be494221 too, run again there by name: `test_audio_output_errors`, `test_audio_wave_buffer_release`, `test_device_lost_exit`, `test_fixed_share_upscale_shader`, `test_fps_stats`, `test_framegen_hdr`, `test_fsr3fi_hud_layer`, `test_fsr3fi_hudless_colour`, `test_fsr4_tune`, `test_game_font`, `test_gfx_effects`, `test_helpers_extract`, `test_lifter`, `test_longshot_builder`, `test_lost_wait_said`, `test_obj_cache_size`, `test_present_acquire_ahead`, `test_present_device_loss`, `test_present_probe`, `test_present_probe_retirement`, `test_present_thread`, `test_queue_priority`, `test_rt_refl_lamps`, `test_submit_oom`, `test_temporal_present_bandwidth`. The 26th, `test_fsr4_own_cache`, said PASS and then failed in its cache's clean-up under the full run's load; alone it passes here twice, as on `main`. Two of them read a file this changes and fail on `main` for the same reason: `test_fps_stats` (a marker `main`'s source no longer has) and `test_gfx_effects` (no glslang under that name: `run_all.py` looks for `glslangValidator`, tools.lock ships `glslang.exe`). **Still to test:** - Linux, any controller: the left stick in the Insert menu, expecting it to move the menu as on Windows (@Beanstalk a Linux run: open the Insert menu with a controller and move through its tabs with the left stick). ## Measurements **Verdict:** fixed: the left stick moves the Insert menu here and does not on `main`. Nothing to measure for speed: the change adds a few comparisons to each read of the pads (every 2 ms at most) and to each present while a page is hosted. Measured on `main` @ be494221; rebased since on 6c06d981, which changes none of this PR's code, so the result still holds. Setup: Windows 11 (build 26300), RTX 3070 (NVIDIA 621.47); the game-free check, and the Insert menu in the game with a Switch 2 Pro Controller over USB, a DualShock 4 and Joy-Cons. | | Before: main @ be494221 | After: this PR @ db4185d2 | |---|---|---| | `tests/test_menu_left_stick.py` | fails: no left stick direction for the menu | passes (gcc, g++, clang, clang++) | | The left stick in the Insert menu | the focus stays put | moves like the D-pad, repeats when held | | The left stick with the menu closed | walks Link | walks Link | | The menu opened with the stick already pushed | nothing moves | nothing moves until let go and pushed again | ## Risks - **Every controller player's Insert menu:** the left stick now moves it. A worn stick that rests past half its travel would move the menu on its own; past the dead zone, the game would walk Link on its own too, and the Stick dead zone row covers both. - **The game's input is untouched:** the new bits are past `HOS_PAD_N`, where no control can be bound (the binds take 0 to `HOS_PAD_N - 1`), and the game's buttons are read through the binds. - Turning it off: a revert. Nothing changes after updating: saves and settings are untouched. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [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). (Testing names them.) - [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. (None needed updating: every check that reads the changed files passes, but those named under Testing, which fail on `main` too.) - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Built on Windows with llvm-mingw, `dev.py rt`. On Linux, from the diff: `host/nn_hid.c` gains `pad_left_stick_way`, plain C on `int32_t` and `uint64_t` that the new check compiles, and one line in `pads_read` reading `pad_raw_now` as `hos_pad_raw` already does on Linux; the `HOS_PAD_LS_*` bits are `vk_api.h`'s, which CI's Linux renderer build compiles. No path handling changes. The Linux run itself is in Still to test, asked of the Test Farm.) - [x] Docs updated. (`docs/user/graphics-and-controls.md`: the D-pad or the left stick chooses; `docs/dev/reference/ui-draw-list.md`: `nav`.) - [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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Insert menu (gpu/vk/vk_ui.cpp) moves on the D-pad's bits of hos_pad_raw only, so on a
controller the left stick does nothing there. This check fails on main for that reason:
nn_hid.c reads the stick into no direction the menu could take.

It drives host/nn_hid.c pad_left_stick_way (on past half the stick's travel, held until
that axis is back under 30 percent) and gpu/vk/vk_ui_keys.h pad_ways (the D-pad, and the
stick only while the menu is open), and reads where each is called.

Co-Authored-By: dyst <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(input): the left stick moves the Insert menu as the D-pad does
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
d387b2be22
On a controller the Insert menu moved on the D-pad only: gpu/vk/vk_ui.cpp took its moves
from the D-pad's bits of hos_pad_raw, and the left stick was no input there, while the
game's own menus follow it.

host/nn_hid.c pads_read now adds the left stick pushed one way to the pads' inputs as bits
of their own past HOS_PAD_N (HOS_PAD_LS_*, gpu/vk/vk_api.h), as the right stick's for the
ocarina: the way it leans most once past half its travel, held until that axis comes back
under 30 percent, so a stick resting near the line or turning toward a diagonal does not
press again. No control can be bound to them, so the game and the Controls page never see
them. gpu/vk/vk_ui_keys.h pad_ways turns the D-pad and those bits into the menu's four moves,
the stick's only while the menu is open (in play it walks Link, and a mod's debug page
beside the game must not move with him); held, they repeat as the D-pad's did.

The stick's reading is dyst's stick_dirs from #2421, which could not land: the menu it read
for (gpu/vk/vk_menu.cpp) has since left the renderer.

Co-Authored-By: dyst <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Windows 11 (build 26300), RTX 3070 (NVIDIA 621.47), this branch's runtime over the shared base: in the Insert menu, the left stick moved through tabs and rows like the D-pad and repeated when held, with a Switch 2 Pro Controller over USB, a DualShock 4 and four Joy-Cons; a stick at rest did not move it, the stick still walked Link with the menu closed, the Controls page did not bind it. dev.py smoke PASS. No fatal line.

Tested in game: Windows 11 (build 26300), RTX 3070 (NVIDIA 621.47), this branch's runtime over the shared base: in the Insert menu, the left stick moved through tabs and rows like the D-pad and repeated when held, with a Switch 2 Pro Controller over USB, a DualShock 4 and four Joy-Cons; a stick at rest did not move it, the stick still walked Link with the menu closed, the Controls page did not bind it. dev.py smoke PASS. No fatal line.
Author
Contributor

Measurements as a table: the check and the in-game behaviour, main against this PR.

Measurements as a table: the check and the in-game behaviour, main against this PR.
Member
@review
BeanBot left a comment

Recommendation: Request changes. The menu can treat a stick already held for movement as a new navigation press when it opens. The new check also requires GCC even when the suite is configured to use another supported C compiler.

The change adds left-stick navigation and repeat to the Insert menu using direction bits in the host’s pad input. It fixes the reported behavior in the author’s Windows controller runs, but introduces an unintended menu press on opening and a compiler dependency in the test suite.

Blocking (1): must change before merging.

  1. L1 gpu/vk/vk_ui.cpp:768: Opening the menu turns a stick direction that was already held into a new menu press. (more on the line) Do: Track the stick’s physical held state across the menu transition and only arm its navigation after release, then add a test that opens the menu with a direction already held.

Should fix (1): not blocking, but worth doing before merging.

  • L2 tests/test_menu_left_stick.py:27: The suite hard-codes gcc for the C fixture instead of using its configured C compiler. (more on the line) Do: Pass the runner’s {cc} to the check, support compiler commands with arguments, and honor CC for direct invocation.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 host/nn_hid.c:925: The new host input path has not been exercised in game on Linux. (more on the line) Do: Run the menu navigation, hold and release, and gameplay checks on Linux with a controller and record the result.

@fix can do L1 and L2.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. The author reports that the stick did not move the menu on the base and moved and repeated on this head with three controller types on Windows. Linux behavior has not yet been tested in game.

Other systems: The direction bits are outside the bindable button range and do not alter the stick axes passed to gameplay. The menu’s input path also serves hosted mod pages; the stick is excluded from their navigation when the Insert menu is closed. Linux and Steam Deck controller behavior remain unverified.

Switches: None.

Reviewed: d387b2be22 against be4942212e: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both commits, the full diff, vk_ui_keys.h and the new test in full. Read the changed host and renderer sections and their input, menu and test-runner callers; skimmed the remaining portions of the larger changed code and documentation files. The named review checklist and adjacent Tooling checkout were unavailable. No generated files or recorded runs were changed.; nothing run (a code review).

Checked and fine:

  • The new bits do not overlap the existing right-stick or touchpad bits.
  • The renderer interface structs are unchanged, so this diff does not require an API version bump.
  • Both commits record AI assistance; no game-derived output, generated file or third-party change appears in the diff.

Testing: No commands from the pull request, builds or tests were run, as requested. The assessment uses the author’s reported runs and read-only source inspection; CI was still running.

Overlaps and merge order: PR #2421 contains the attributed stick-reading approach alongside another menu change; the description says it cannot land as it stands. PR #3244 is a prerequisite for the stated Switch 2 Pro Bluetooth test.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The menu can treat a stick already held for movement as a new navigation press when it opens. The new check also requires GCC even when the suite is configured to use another supported C compiler. The change adds left-stick navigation and repeat to the Insert menu using direction bits in the host’s pad input. It fixes the reported behavior in the author’s Windows controller runs, but introduces an unintended menu press on opening and a compiler dependency in the test suite. **Blocking (1)**: must change before merging. 1. **L1** `gpu/vk/vk_ui.cpp:768`: Opening the menu turns a stick direction that was already held into a new menu press. (more on the line) **Do:** Track the stick’s physical held state across the menu transition and only arm its navigation after release, then add a test that opens the menu with a direction already held. **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `tests/test_menu_left_stick.py:27`: The suite hard-codes gcc for the C fixture instead of using its configured C compiler. (more on the line) **Do:** Pass the runner’s {cc} to the check, support compiler commands with arguments, and honor CC for direct invocation. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `host/nn_hid.c:925`: The new host input path has not been exercised in game on Linux. (more on the line) **Do:** Run the menu navigation, hold and release, and gameplay checks on Linux with a controller and record the result. `@fix` can do L1 and L2. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that the stick did not move the menu on the base and moved and repeated on this head with three controller types on Windows. Linux behavior has not yet been tested in game. **Other systems:** The direction bits are outside the bindable button range and do not alter the stick axes passed to gameplay. The menu’s input path also serves hosted mod pages; the stick is excluded from their navigation when the Insert menu is closed. Linux and Steam Deck controller behavior remain unverified. **Switches:** None. **Reviewed:** d387b2be2252 against be4942212e1d: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both commits, the full diff, vk_ui_keys.h and the new test in full. Read the changed host and renderer sections and their input, menu and test-runner callers; skimmed the remaining portions of the larger changed code and documentation files. The named review checklist and adjacent Tooling checkout were unavailable. No generated files or recorded runs were changed.; nothing run (a code review). **Checked and fine:** - The new bits do not overlap the existing right-stick or touchpad bits. - The renderer interface structs are unchanged, so this diff does not require an API version bump. - Both commits record AI assistance; no game-derived output, generated file or third-party change appears in the diff. **Testing:** No commands from the pull request, builds or tests were run, as requested. The assessment uses the author’s reported runs and read-only source inspection; CI was still running. **Overlaps and merge order:** PR #2421 contains the attributed stick-reading approach alongside another menu change; the description says it cannot land as it stands. PR #3244 is a prerequisite for the stated Switch 2 Pro Bluetooth test. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
gpu/vk/vk_ui.cpp Outdated
@ -760,15 +765,17 @@ void ui_tick() {
const bool pass = ours && (last & MKW_UI_OUT_PASS_INPUT) && !(last & MKW_UI_OUT_TEXT);
const uint32_t raw = host->pad_raw ? host->pad_raw() : 0, press = raw & ~pad_held;
pad_held = raw;
const uint32_t ways = ui_keys::pad_ways(raw, modal), way_press = ways & ~ways_held;
Member

L1 (blocking): Opening the menu turns a stick direction that was already held into a new menu press.

When: While walking with the stick held up, the closed-menu calculation excludes the stick and records no up direction in ways_held. Opening the menu while still holding it makes way_press include up, so the menu moves immediately and then repeats without a new push.

Do: Track the stick’s physical held state across the menu transition and only arm its navigation after release, then add a test that opens the menu with a direction already held.

**L1** (blocking): Opening the menu turns a stick direction that was already held into a new menu press. *When:* While walking with the stick held up, the closed-menu calculation excludes the stick and records no up direction in ways_held. Opening the menu while still holding it makes way_press include up, so the menu moves immediately and then repeats without a new push. **Do:** Track the stick’s physical held state across the menu transition and only arm its navigation after release, then add a test that opens the menu with a direction already held.
host/nn_hid.c Outdated
@ -906,6 +922,7 @@ static void pads_read(uint64_t *buttons, int32_t stick[4], int *deck_builtin_inp
if (!sdl_pads || poll_xinput_env) xinput_read(now, &raw, s, &xinput_pads);
if (!sdl_pads && xinput_pads > 0) controlled = xinput_pads; /* (XInput-only: no SDL pad to count it) */
raw |= pad_right_stick_way(s);
raw |= pad_left_stick_way(s[0], s[1], (uint64_t)(uint32_t)pad_raw_now & HOS_PAD_LS_MASK);
Member

L3 (should fix): The new host input path has not been exercised in game on Linux.

When: A Linux controller player uses the new host-to-menu path, but the reported controller runs cover Windows only.

Do: Run the menu navigation, hold and release, and gameplay checks on Linux with a controller and record the result.

**L3** (should fix): The new host input path has not been exercised in game on Linux. *When:* A Linux controller player uses the new host-to-menu path, but the reported controller runs cover Windows only. **Do:** Run the menu navigation, hold and release, and gameplay checks on Linux with a controller and record the result.
@ -0,0 +24,4 @@
sys.path.insert(0, str(Path(__file__).resolve().parent)) # (tests/srccut.py: python -I leaves this folder off the path)
from srccut import block # noqa: E402
RUN_ALL_ARGS = ["--cc", "gcc", "--cxx", "{cxx}"]
Member

L2 (should fix): The suite hard-codes gcc for the C fixture instead of using its configured C compiler.

When: On a supported Windows or Linux setup with clang available but no gcc, run_all.py marks this check missing and strict mode fails, even when CC=clang. A configured CC is ignored when gcc is present as well.

Do: Pass the runner’s {cc} to the check, support compiler commands with arguments, and honor CC for direct invocation.

**L2** (should fix): The suite hard-codes gcc for the C fixture instead of using its configured C compiler. *When:* On a supported Windows or Linux setup with clang available but no gcc, run_all.py marks this check missing and strict mode fails, even when CC=clang. A configured CC is ignored when gcc is present as well. **Do:** Pass the runner’s {cc} to the check, support compiler commands with arguments, and honor CC for direct invocation.
fofuxo force-pushed fix/menu-left-stick from d387b2be22
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to db4185d2e5
Some checks failed
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-06 04:32:12 +00:00
Compare
Author
Contributor

Thanks. Pushed db4185d2 (the branch rewritten so it still reads test, then fix):

  • L1 (fixed): gpu/vk/vk_ui_keys.h PadWays keeps every way held across presents, the left stick's too whether or not the menu takes it, so a stick already pushed as the menu opens is no press and starts no repeats; it moves the menu once let go and pushed again, as the D-pad held through the opening does. tests/test_menu_left_stick.py drives it present by present (the menu opening with the stick up, let go, pushed again; the D-pad and the stick held together), and fails with PadWays keeping only what the menu took. Checked in the game too: with Link walking, the menu opened with the stick still pushed selected and moved nothing; let go and pushed again, it moved.
  • L2 (fixed): the check takes run_all.py's {cc} and {cxx}, else CC and CXX, else gcc and g++, and splits a command with arguments. Run with gcc/g++, clang/clang++, and CC=clang CXX=clang++.
  • L3: a Linux run is still to do; it is in Still to test, and I have no Linux machine with a controller here.
Thanks. Pushed `db4185d2` (the branch rewritten so it still reads test, then fix): - **L1** (fixed): `gpu/vk/vk_ui_keys.h` `PadWays` keeps every way held across presents, the left stick's too whether or not the menu takes it, so a stick already pushed as the menu opens is no press and starts no repeats; it moves the menu once let go and pushed again, as the D-pad held through the opening does. `tests/test_menu_left_stick.py` drives it present by present (the menu opening with the stick up, let go, pushed again; the D-pad and the stick held together), and fails with `PadWays` keeping only what the menu took. Checked in the game too: with Link walking, the menu opened with the stick still pushed selected and moved nothing; let go and pushed again, it moved. - **L2** (fixed): the check takes run_all.py's `{cc}` and `{cxx}`, else `CC` and `CXX`, else gcc and g++, and splits a command with arguments. Run with gcc/g++, clang/clang++, and `CC=clang CXX=clang++`. - **L3**: a Linux run is still to do; it is in *Still to test*, and I have no Linux machine with a controller here.
Author
Contributor

@Beanstalk on Linux, any GPU, with a controller: build this PR, then in the Insert menu move through the tabs and rows with the left stick (it should move like the D-pad and repeat when held), open the menu while walking with the stick still pushed (nothing should move until the stick is let go and pushed again), and close the menu and walk (the stick should walk Link as on main).

@Beanstalk on Linux, any GPU, with a controller: build this PR, then in the Insert menu move through the tabs and rows with the left stick (it should move like the D-pad and repeat when held), open the menu while walking with the stick still pushed (nothing should move until the stick is let go and pushed again), and close the menu and walk (the stick should walk Link as on main).
Member

@fofuxo 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 db4185d, and the PR has changed since (e01c844), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@fofuxo 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 `db4185d`, and the PR has changed since (`e01c844`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
fofuxo force-pushed fix/menu-left-stick from db4185d2e5
Some checks failed
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to e01c844469
Some checks are pending
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Waiting to run
beanstalk/approval waiting for a BigBean's 👍 on the request
2026-12-06 06:25:40 +00:00
Compare
Author
Contributor

Rebased on main @ 6c06d981 (head e01c8444, no conflict; main touched only docs/user/graphics-and-controls.md among this PR's files, another paragraph). tests/test_menu_left_stick.py passes, and tests/run_all.py --strict --changed origin/main gives the same 79 passed, 2 failed (test_fps_stats, test_gfx_effects, which fail on main too), 6 skipped. The code is unchanged by the rebase, so the in-game runs and the measurement at db4185d2 still hold.

The Linux box is ticked from the diff (the reason is beside it); the Linux run in the game stays in Still to test for the Test Farm, which comes during review.

Rebased on `main` @ 6c06d981 (head `e01c8444`, no conflict; `main` touched only `docs/user/graphics-and-controls.md` among this PR's files, another paragraph). `tests/test_menu_left_stick.py` passes, and `tests/run_all.py --strict --changed origin/main` gives the same 79 passed, 2 failed (`test_fps_stats`, `test_gfx_effects`, which fail on `main` too), 6 skipped. The code is unchanged by the rebase, so the in-game runs and the measurement at `db4185d2` still hold. The Linux box is ticked from the diff (the reason is beside it); the Linux run in the game stays in Still to test for the Test Farm, which comes during review.
fofuxo changed title from WIP: fix(input): the left stick moves the Insert menu as the D-pad does to fix(input): the left stick moves the Insert menu as the D-pad does 2026-12-06 06:26:06 +00:00
Author
Contributor

@Beanstalk on Linux, any GPU, with a controller: build this PR, then in the Insert menu move through the tabs and rows with the left stick (it should move like the D-pad and repeat when held), open the menu while walking with the stick still pushed (nothing should move until the stick is let go and pushed again), and close the menu and walk (the stick should walk Link as on main).

@Beanstalk on Linux, any GPU, with a controller: build this PR, then in the Insert menu move through the tabs and rows with the left stick (it should move like the D-pad and repeat when held), open the menu while walking with the stick still pushed (nothing should move until the stick is let go and pushed again), and close the menu and walk (the stick should walk Link as on main).
Member

@fofuxo only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@fofuxo only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Author
Contributor

Tested at e01c8444 with a Switch 2 Pro Controller over Bluetooth (now in main with #3244), no cable: the left stick moves the Insert menu as over USB. Moved from Still to test into Tested; the Linux run for the Test Farm is what is left there.

Tested at `e01c8444` with a Switch 2 Pro Controller over Bluetooth (now in `main` with #3244), no cable: the left stick moves the Insert menu as over USB. Moved from Still to test into Tested; the Linux run for the Test Farm is what is left there.
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The held-stick fix and configured compiler change address the code items. The Linux in-game input run remains outstanding, and CI is still running. Recommend approval; not approved on the forge.

The left stick can navigate and repeat in the Insert menu while retaining its gameplay use. The change adds directional state tracking and a game-free test.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 host/nn_hid.c:925: The new host input path has not been exercised in game on Linux. When: A Linux controller player uses the new host-to-menu path, but the reported controller runs cover Windows only. Do: Run the menu navigation, hold and release, and gameplay checks on Linux with a controller and record the result.

Since the last review (on d387b2be22)
Resolved: L1 (Opening the menu turns a stick direction that was already held into a new menu press.); L2 (The suite hard-codes gcc for the C fixture instead of using its configured C compiler.)
Still open: L3 (The new host input path has not been exercised in game on Linux.)

Checks: Still running: 11 checks.

Also noticed (1; not asked for, not blocking)
  • On Windows, shlex.split with posix=False retains quotes around a quoted compiler executable path, which can prevent a compiler installed under a path containing spaces from being launched.
More: does it help, other systems, switches, what was read

Does it help: Yes. The author reports that the stick did not move the menu on main and did on this PR with three controller types on Windows; the held-through-opening case was also checked in game. This is not a performance change.

Other systems: The host input path also runs on Linux, where an in-game controller run remains outstanding. The new bits sit beyond the bindable range; Windows testing reports that gameplay and binding still work.

Switches: None.

Reviewed: e01c844469 against 6c06d98100: Read AGENTS.md, CONTRIBUTING.md, vk_ui_keys.h and test_menu_left_stick.py in full; inspected the diff, commits, the changed UI and host input paths, and the supplied test reports. Other changed files and surrounding code were skimmed, not read in full.; nothing run (a code review).

Checked and fine:

  • The added test covers a held stick across menu opening, release and a subsequent press.
  • The recorded Windows runs cover navigation, repeats, gameplay and binding behavior.

Testing: No commands that build or run the project were executed. The author reports Windows in-game and game-free checks; the Linux run and current CI results are pending.

Overlaps and merge order: PR #2421 contains the related earlier stick fix; this PR adapts it to the current menu.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The held-stick fix and configured compiler change address the code items. The Linux in-game input run remains outstanding, and CI is still running. Recommend approval; not approved on the forge. The left stick can navigate and repeat in the Insert menu while retaining its gameplay use. The change adds directional state tracking and a game-free test. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `host/nn_hid.c:925`: The new host input path has not been exercised in game on Linux. *When:* A Linux controller player uses the new host-to-menu path, but the reported controller runs cover Windows only. **Do:** Run the menu navigation, hold and release, and gameplay checks on Linux with a controller and record the result. **Since the last review** (on d387b2be2252) Resolved: L1 (Opening the menu turns a stick direction that was already held into a new menu press.); L2 (The suite hard-codes gcc for the C fixture instead of using its configured C compiler.) Still open: L3 (The new host input path has not been exercised in game on Linux.) **Checks:** Still running: 11 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - On Windows, shlex.split with posix=False retains quotes around a quoted compiler executable path, which can prevent a compiler installed under a path containing spaces from being launched. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that the stick did not move the menu on main and did on this PR with three controller types on Windows; the held-through-opening case was also checked in game. This is not a performance change. **Other systems:** The host input path also runs on Linux, where an in-game controller run remains outstanding. The new bits sit beyond the bindable range; Windows testing reports that gameplay and binding still work. **Switches:** None. **Reviewed:** e01c84446988 against 6c06d98100f3: Read AGENTS.md, CONTRIBUTING.md, vk_ui_keys.h and test_menu_left_stick.py in full; inspected the diff, commits, the changed UI and host input paths, and the supplied test reports. Other changed files and surrounding code were skimmed, not read in full.; nothing run (a code review). **Checked and fine:** - The added test covers a held stick across menu opening, release and a subsequent press. - The recorded Windows runs cover navigation, repeats, gameplay and binding behavior. **Testing:** No commands that build or run the project were executed. The author reports Windows in-game and game-free checks; the Linux run and current CI results are pending. **Overlaps and merge order:** PR #2421 contains the related earlier stick fix; this PR adapts it to the current menu. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Some checks are pending
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Waiting to run
beanstalk/approval waiting for a BigBean's 👍 on the request
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/menu-left-stick:fofuxo-fix/menu-left-stick'
git switch 'fofuxo-fix/menu-left-stick'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 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!3307
No description provided.