Repository navigation
feat(input): sprint on Shift or the left stick's press, without the roll - #2604
Open
guilhermebueno6 wants to merge 1 commit into
Open
guilhermebueno6 wants to merge 1 commit into
guilhermebueno6 wants to merge 1 commit into
Conversation
guilhermebueno6
force-pushed
the
feat/sprint
branch
from
November 12, 2026 03:07
bdf7d6f to
6f4f262
Compare
The game runs while A is held, and A pressed while Link moves is a roll. Sprint is a new control, with keys and a gamepad input, that holds A only while Link is steered, started with the stick let go for 120 ms (HOS_SPRINT_STILL_MS) so the run comes without the roll. Tested in game. - Defaults: Shift (held) and the left stick's press (a toggle: pressed once while moving, Link runs until the stick comes back to the middle). B moves from Shift to V; the stick's press is no longer the Switch's LS. - An options file from before Sprint (options_version < 7) that still has Shift on B and the press on LS gets the new defaults; bindings the player changed are kept, and Sprint takes none of its defaults that another control has. - The Controls page has a Sprint row; pad_sprint and key_sprint lines. The Controls tab's Sprint row (HOS_OPT_SPRINT, 52; on by default) turns it off. - HOS_KEY_SPRINT (after the ocarina notes) in vk_api.h: MKWVK_API_VERSION 20. Sprint has two gamepad slots and trades them by the Switch buttons' slot rules; options_version 7. - tests/test_sprint.py: defaults, migration cases, binding swaps, and sprint_step compiled alone (the still start, the hold, the toggle). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guilhermebueno6
force-pushed
the
feat/sprint
branch
from
November 12, 2026 03:14
6f4f262 to
6ecc6a7
Compare
This was referenced Nov 12, 2026
Joey-Magnus
reviewed
Nov 12, 2026
Joey-Magnus
left a comment
Contributor
There was a problem hiding this comment.
I merged this into current main (it merges cleanly) and ran tests/run_all.py on Linux. 458 checks pass. The only failures are test_lift_cache, which fails on main on this machine too, and a test_recorder_sync timeout that passes when run alone. test_sprint, test_bound_keys, test_input_background and the menu tests all pass. Points for you and the maintainers:
- This changes defaults for every player. The keyboard's B moves from Shift to V, and the left stick's press stops being the Switch's LS. binds_sprint_migrate (host/nn_hid.c:569) also rewrites existing options files that still have the old defaults. A maintainer should agree to that first.
- Each time a sprint starts, sprint_step zeroes the stick for 120 ms (HOS_SPRINT_STILL_MS) with A held down. If Link is facing an NPC, a sign, a chest or a pot, that's an A press while standing. Pressing Shift right next to one could then talk, open or pick up, which is the very thing the steered gate is meant to prevent. Please check it in the game.
- MKWVK_API_VERSION 20 is also claimed by #2600, #2317, #2261 and #2566. options_version=7 is free today.
The screenshots of the two new rows are still "to be added". CONTRIBUTING asks for them on changes that show on screen.
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On keyboard and mouse there is no way to run without holding the game's A key, and pressing A while moving makes Link roll first. This adds a Sprint control: hold Shift, or press the left stick once on a controller, and Link runs without the roll.
What changed
HOS_KEY_SPRINT, after the ocarina note controls): keys and two gamepad slots, which trade inputs with the Switch buttons by the same slot rules (the ocarina notes keep sharing theirs). It holds A, the game's own run, only while the left stick or the movement keys are pushed, so standing still it does not talk, open or pick up.HOS_SPRINT_STILL_MS=<ms>inhookshot_env.txttunes it (0 = the old behaviour, with the roll).options_version< 7) that still has the old defaults (Shift on B, the press on LS) gets the new ones; anything the player bound differently is kept, and Sprint takes none of its defaults another control already has. The menu now writesoptions_version=7.pad_sprint/key_sprintlines) and an on/off Sprint row on the Controls tab (HOS_OPT_SPRINT, 52; on by default).MKWVK_API_VERSION20:binding/bindtake gamepad inputs forHOS_KEY_SPRINT.Testing
python -I -B tests/run_all.pyon Windows 11 (llvm-mingw): 402 passed, 15 failed; an unmodifiedmainon the same PC fails the same 15 (401 passed), so nothing new fails andtest_sprintis the extra pass. (test_input_backgroundis among them on this compiler: clang's-Wunused-but-set-globalon main'soc_consumed_pads. With that warning off it passes with Sprint.)tests/test_sprint.py: the binding table compiled alone against six options files (new install, old defaults migrated from version 4 and from version 6, rebound kept, V taken, version 7 kept) and binding swaps;sprint_stepcompiled alone (the still start, Shift held, the toggle and its end, nothing with the menu open); source checks for the menu rows, the option and the A-hold gate.test_input_background,test_bound_keysandtest_menu_env_overridesupdated for the new control.hid: Shift is Sprint now, B is Vin the log).Screenshots
To be added: the Controls tab's Sprint row and the Controls page's Sprint row.
🤖 Generated with Claude Code