fix(prompts): the Keyboard prompts show the movement keys as they are bound #529
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!529
Loading…
Reference in a new issue
No description provided.
Delete branch "jarynclouatre/Longshot:fix/keyboard-move-key-pictures"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: Linux x86-64 (game-free checks only) · Needs: none
Why
With Button prompts on Keyboard, the left stick's icons always show W, A, S and D.
The pictures are fixed at the build (
nx2/prompt_draw.pykeyboard_glyphs, fromprompt_keys.MOVE),cmap4_bindinhost/prompts.calways points the stick codes at them, andcurrent_bindsreads only the Switch buttons' controls.Found reading
host/prompts.candnx2/prompt_draw.pyagainst the Controls page's movement rows.How to reproduce
Seen on: found reading
host/prompts.candnx2/prompt_draw.py; not seen in the game. Game-free checks on Linux x86-64.Settings and switches: Button prompts on Keyboard; Move up bound to I on the Controls page.
Steps: Look at a prompt for "stick up" after binding Move up to I. Restart, or change a movement key while the game runs.
Expected: The prompt shows the bound movement key, at the start and after a change while the game runs.
Actual: Bind Move up to I on the Controls page and a prompt for "stick up" still shows W, which no longer moves Link. A restart doesn't change it, and a movement key changed while the game runs isn't noticed at all.
What changed
Keyboard prompts follow the movement keys on the Controls page, including changes while the game runs. A single direction shows its key when the font has an icon; other changed directions fall back to the game's stick icon.
host/prompts.c): a newstick_shows(i, move)says what each stick icon shows on the Keyboard face from the first key of Move up, down, left and right:cmap4_binduses it for the font served at the start and after a change.text_codeuses it for texts rewritten after a change while the game runs. A direction on a non-default key takes a code of its own from the existingkey_slotcodes, the way a button on a key does, because the game keeps each code's glyph as first drawn.text_codemaps such a code back to its stick, so a later change or another face still finds it.current_bindscarries the four movement keys after the buttons' controls (BINDSgrows by 4), sohos_prompts_livesees a movement key change and serves the font again. The textures and the layouts compare only the buttons' part (BUTTON_BINDS), and the textures' cache key hashes only that part, so a movement key change rewrites neither and no player's cache is written again because of this change.README.md,nx2/prompt_keys.py): the Button prompts paragraph and the table's comment say what the stick icons show now.tests/test_prompt_font_bind.py): the stand-in controls have the four movement rows with both slots, and the test cmap has the icons for W, A, S, D and I. Five sets of movement keys (the defaults, up on I, up on I in the second slot only, up on a key without an icon, up unbound) are checked through the realcmap4_bind,text_codeandcurrent_binds. One text's up icon is followed through W, I, E, W and a pad's face.stick_waysandmove_defaultare compared withprompt_keys.STICKSandMOVE. The stand-inkey_slotnow refuses a key without an icon, as the real one does.Measurements
Verdict: the movement-key prompt check fails on main and passes here; the suite has the same three failures on both sides.
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; branch
fix/keyboard-move-key-pictures.python3 -I -B tests/run_all.py --jobs 4 --timeout 120, main and this PR in turn, two runs each. The branch'stests/test_prompt_font_bind.pywas also run over main'shost/prompts.c.How to reproduce: the commands above in a checkout of each commit
543846eba8bd1592tests/run_all.py(run 1, run 2)test_bake_portability.py,test_crash_record.py,test_walk_key.pytests/test_prompt_font_bind.pyFAIL: the keyboard face, up on I: stick icon 1 (U+E052, u) on glyph 987, not 973In the test's cmap glyph 987 is W's icon and 973 is I's.
test_bake_portability.pyfails here for a missing Python module (zstandard).test_walk_key.py's fixture doesn't link on main (undefined reference to hos_oot_autoload_input).test_crash_record.pystopped in all four runs atassert child.wait(timeout=10) == -signo, a signalled child's exit status on this PC.Flags and settings
None.
Testing
Tested: the game-free suite on a Linux PC, as in Measurements; the test compiles
first_key,current_binds,stick_shows,cmap4_bind,bind_fontandtext_codefromhost/prompts.cwith gcc.host/prompts.ccompiles (-fsyntax-only -Wall -Wextra) with llvm-mingw 20261104's x86_64-w64-mingw32-clang with no warnings, and whole with gcc intests/test_mods_size_table.py's fixture.Not tested: the game. A look at a prompt with the left stick's icon after binding Move up to another key, at the start and while the game runs, would show it.
No screenshots taken: the game was not run.
Must be tested: None.
Risks
What could break: Each direction on a non-default key takes one of the 320
key_slotcodes per key it was seen on.The change touches
current_bindson the line under the one #485 changes; whichever lands second needs a two-line rebase.Turning it off: Reverting the commit puts the fixed pictures back.
Compatibility: With the default movement keys every icon and every text code is what main gives. Only a movement key bound to something else shows something new. An icon for several directions then falls back to the game's stick icon instead of a picture of the new keys; drawing those would be a build-side change.
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
mainand passing here.tests/that reads changed source updated in this PR, not weakened.WIP: fix(prompts): the Keyboard prompts show the movement keys as they are boundto fix(prompts): the Keyboard prompts show the movement keys as they are boundView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.