Repository navigation
feat(input): hold-to-toggle for any bound button - #2886
Open
simonwjackson wants to merge 1 commit into
Open
simonwjackson wants to merge 1 commit into
simonwjackson wants to merge 1 commit into
Conversation
Let either gamepad binding or a bound key latch a Switch button until the next press. Keep every flag Off by default, and release latches on menu, focus and binding changes. Carry the enabled-button mask through the existing option callback (option 54); neither API struct changes. Assisted-by: OpenAI GPT-6 Astra Co-Authored-By: OpenAI GPT-6 Astra <noreply@openai.com>
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.
Players who cannot keep a button held need another way to shield, target or aim. This adds an opt-in press-once, press-again alternative for any bound button (Game Accessibility Guidelines, motor: avoid holding buttons; Xbox Accessibility Guideline 107).
What changed
MkwVkHostnorMkwVkRendererchanges, andMKWVK_API_VERSIONis not bumped; an older renderer answers an unknown option with zero, which leaves the feature Off.Run in the game
RX 7900 XT, RADV (Mesa 26.2.3), Ryzen 5 7600X, 32 GB, NixOS 26.11 / Linux 7.2.7, headless Sway 1.12 + Xwayland, 1920x1080 window, compute mesh path, udmabuf on, audio off, copied saves. Hyrule Castle Town (
Market_Child), indoors by the wooden door. 8 min 38 s, ended cleanly through the control socket, no GPU hang or device-lost line.ZL's flag was changed on the Controls page, and presses were sent through the control socket (#926):
After the first press ended (queue empty at present 15,956; the press was queued at 15,750), the shield stays up:
After the second press:
More frames: On while pressed, Off while pressed, Off after release, released after opening Insert.
Game fps from the log's
N presents, X fpslines, three 45-second samples standing still with no button held:No measurable cost in this scene. Both runs are in
docs/tested-configurations.md, including an earlier start that ended before gameplay because shader preparation had not finished.The run used
3b3da943on maindae19300(buildpr-hold-3b3da943daa1, source8fa27ae9). The branch was then rebased onto newer main, squashed to one commit, and the option ID moved from 53 to 54 to stay clear of #2860; it was not run in the game again after that.Checks
python -I -B tests/run_all.pyon the run's source: 499 passed, 2 failed, 20 skipped (Windows-only, or need the game). Both failures were the same on untouched main at that time and are fixed there now (docs(readme): the option table has the Skip opening row, so main's readme check passes #2857, fix(tests): the one-variant cache test builds with the compressed program cache in the tree #2861).test_hold_toggle,test_option_ids,test_opening_skip,test_menu_i18n,test_readme_menu_rows,test_bound_keys,test_input_background,test_menu_keys,test_menu_hitandtest_display_pointer.Limits and not tested