fix(input): Walk mode set to Hold in the Insert menu drops a toggled walk #537

Open
jarynclouatre wants to merge 1 commit from jarynclouatre/Longshot:fix/walk-hold-in-menu into main
Contributor

Type: fix · Risk: low · Tested on: Linux x86-64 (game-free checks only) · Needs: none

Why

#66 says choosing Hold clears a toggled walk.

walk_held (host/nn_hid.c) cleared it for Hold only on a read the game owns. While the Insert menu has the keys, read_input passes readable 0, and the function returned before reaching the Hold reset.

None filed. Found reading walk_held against #66's description.

How to reproduce

Seen on: found reading the code; not seen in the game
Settings and switches: Walk mode: Toggle, then Hold and Toggle again in the Insert menu.
Steps: With Walk mode on Toggle, tap the Walk key (Link walks), open the Insert menu, choose Hold for Walk mode, then Toggle again, and close the menu.
Expected: Choosing Hold clears the toggled walk, as #66 says; Link is not walking without another Walk press.
Actual: Link still walks, with no Walk press.

What changed

Choosing Hold for Walk mode in the Insert menu now clears a toggled walk at once. Switching away from the window still keeps a toggled walk.

  • input (host/nn_hid.c): walk_held clears the toggled walk for Hold first, before the return taken while the menu has the keys. The menu's was_down = 1 is unchanged, so a key held as the menu closes still needs a release. The read made while the window is behind another one called walk_held(0, 0, 0), Hold, only to mark the key as held; it now passes the Walk mode, so Alt+Tab keeps a toggled walk as before.
  • tests (tests/test_walk_key.py): Toggle on, the menu opened, a read in Hold and one in Toggle, the menu closed, no Walk press: not walking; the next press walks again. The fixture gets the no-op hos_oot_autoload_input it needs to link since #399; #497 adds the same line, so whichever lands second drops it.

Measurements

Verdict: the new case fails with main's input code and passes here; the walk test now links and passes, with no new suite failures.

Hardware: none used (game-free checks on a Linux x86-64 PC, gcc 15.2, Python 3.14)
Scene: none, the game was not run
Method: 2026-11-14. python3 -I -B tests/run_all.py, two runs each, interleaved (main, PR, main, PR). The new case also ran with main's host/nn_hid.c. Branch: fix/walk-hold-in-menu.
How to reproduce: the commands above in a checkout of each commit

Before: main @ 1be60eae After: this PR @ e2057708
tests/run_all.py (run 1, run 2) 485 passed, 2 failed, 84 skipped; 484 passed, 3 failed, 84 skipped 486 passed, 1 failed, 84 skipped (both)
failing checks test_bake_portability.py, test_walk_key.py; in run 2 also test_oot_state_tap.py test_bake_portability.py
tests/test_walk_key.py, main's nn_hid.c fails at the new case: still walking after the menu closed passes

test_bake_portability.py fails here for a missing Python module (zstandard). test_oot_state_tap.py failed once on main and passed in the other five runs here. On main test_walk_key.py's fixture doesn't link (undefined reference to hos_oot_autoload_input); here it links and passes.

Flags and settings

None.

Testing

Tested: the game-free suite on a Linux PC, as in Measurements. tests/test_input_background.py (it runs the same read_input) passes.

Not tested: the game with a keyboard.

Must be tested: None.

Risks

What could break: #497 adds the same fixture line.

Turning it off: Reverting the commit puts the reset back below the menu's return.

Compatibility: Choosing Hold in the Insert menu now drops a toggled walk at once, as choosing it in play did.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
**Type:** fix · **Risk:** low · **Tested on:** Linux x86-64 (game-free checks only) · **Needs:** none ## Why #66 says choosing Hold clears a toggled walk. `walk_held` (`host/nn_hid.c`) cleared it for Hold only on a read the game owns. While the Insert menu has the keys, `read_input` passes `readable` 0, and the function returned before reaching the Hold reset. None filed. Found reading `walk_held` against #66's description. ## How to reproduce **Seen on:** found reading the code; not seen in the game **Settings and switches:** Walk mode: Toggle, then Hold and Toggle again in the Insert menu. **Steps:** With Walk mode on Toggle, tap the Walk key (Link walks), open the Insert menu, choose Hold for Walk mode, then Toggle again, and close the menu. **Expected:** Choosing Hold clears the toggled walk, as #66 says; Link is not walking without another Walk press. **Actual:** Link still walks, with no Walk press. ## What changed Choosing Hold for Walk mode in the Insert menu now clears a toggled walk at once. Switching away from the window still keeps a toggled walk. - input (`host/nn_hid.c`): `walk_held` clears the toggled walk for Hold first, before the return taken while the menu has the keys. The menu's `was_down = 1` is unchanged, so a key held as the menu closes still needs a release. The read made while the window is behind another one called `walk_held(0, 0, 0)`, Hold, only to mark the key as held; it now passes the Walk mode, so Alt+Tab keeps a toggled walk as before. - tests (`tests/test_walk_key.py`): Toggle on, the menu opened, a read in Hold and one in Toggle, the menu closed, no Walk press: not walking; the next press walks again. The fixture gets the no-op `hos_oot_autoload_input` it needs to link since #399; #497 adds the same line, so whichever lands second drops it. ## Measurements **Verdict:** the new case fails with main's input code and passes here; the walk test now links and passes, with no new suite failures. Hardware: none used (game-free checks on a Linux x86-64 PC, gcc 15.2, Python 3.14) Scene: none, the game was not run Method: 2026-11-14. `python3 -I -B tests/run_all.py`, two runs each, interleaved (main, PR, main, PR). The new case also ran with main's `host/nn_hid.c`. Branch: `fix/walk-hold-in-menu`. How to reproduce: the commands above in a checkout of each commit | | Before: main @ 1be60eae | After: this PR @ e2057708 | |---|---|---| | `tests/run_all.py` (run 1, run 2) | 485 passed, 2 failed, 84 skipped; 484 passed, 3 failed, 84 skipped | 486 passed, 1 failed, 84 skipped (both) | | failing checks | `test_bake_portability.py`, `test_walk_key.py`; in run 2 also `test_oot_state_tap.py` | `test_bake_portability.py` | | `tests/test_walk_key.py`, main's `nn_hid.c` | fails at the new case: still walking after the menu closed | passes | `test_bake_portability.py` fails here for a missing Python module (zstandard). `test_oot_state_tap.py` failed once on main and passed in the other five runs here. On main `test_walk_key.py`'s fixture doesn't link (`undefined reference to hos_oot_autoload_input`); here it links and passes. ### Flags and settings None. ## Testing **Tested:** the game-free suite on a Linux PC, as in Measurements. `tests/test_input_background.py` (it runs the same `read_input`) passes. **Not tested:** the game with a keyboard. **Must be tested:** None. ## Risks **What could break:** #497 adds the same fixture line. **Turning it off:** Reverting the commit puts the reset back below the menu's return. **Compatibility:** Choosing Hold in the Insert menu now drops a toggled walk at once, as choosing it in play did. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened.
fix(input): Walk mode set to Hold in the Insert menu drops a toggled walk
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
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
PR description / Description follows the template (pull_request_target) Successful in 5s
beanstalk/approval Test farm not requested
Website / Website on Cloudflare (pull_request_target) Has been skipped
e205770829
walk_held cleared the toggled walk for Hold only on a read the game
owns, below the return taken while the Insert menu has the keys. Walk
mode Toggle, a tap of Walk, then Hold and Toggle again in the menu: Link
walked after the menu closed with no Walk press, though #66 says
choosing Hold clears the selection.

The Hold reset now comes first. The read made while the window is
behind another one passes the Walk mode instead of Hold, so Alt+Tab
keeps a toggled walk as before.

tests/test_walk_key.py gets the no-op hos_oot_autoload_input that its
fixture needs to link since #399 (#497 adds the same line).
jarynclouatre changed title from WIP: fix(input): Walk mode set to Hold in the Insert menu drops a toggled walk to fix(input): Walk mode set to Hold in the Insert menu drops a toggled walk 2026-11-14 18:45:29 +00:00
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
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
PR description / Description follows the template (pull_request_target) Successful in 5s
beanstalk/approval Test farm not requested
Website / Website on Cloudflare (pull_request_target) Has been skipped
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/walk-hold-in-menu:jarynclouatre-fix/walk-hold-in-menu'
git switch 'jarynclouatre-fix/walk-hold-in-menu'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!537
No description provided.