fix(input): the touchpad opens the menu only when it is the Controller menu button (#2623) #3026
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
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
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3026
Loading…
Reference in a new issue
No description provided.
Delete branch "cuecuemoar/Longshot:fix/touchpad-menu-button"
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?
Summary
On a DualShock 4 or DualSense, clicking the touchpad opened the Insert menu whatever Controls → Controller menu
button said: at None, and at the default Home too. With DS4Windows sending Share for the touchpad, the game's
map also opened behind the menu (#2623). The touchpad's click was wired to F1 in
8790b8f62, and that line was never tiedto the row.
How to see it on
main: a DualShock 4 or DualSense, Controller menu button at None (or Home), click the touchpad inplay: the Insert menu opens.
This change:
controller_menu_buttonis unchanged);GR the click does nothing: the game has no touchpad, its bit is past the Switch's inputs (
HOS_PAD_N);gpu/vk/vk_api.h(noMkwVkHostorMkwVkRendererchange, so no API version bump);open" entry of common issues.
Read first:
game/crates/api/src/services/menu_input.rs(the Controller menu button handling) andgame/mods/interface/mod.toml(the row's options and help). Thetranslations of "Touchpad" and the new help in
game/mods/menu/strings/*.jsonare machine-written: a native speaker'slook is welcome.
Fixes #2623
Testing
Tested:
Head
10f940cee(test15290398c, fix328b7e1b1, docs10f940ceefrom BeanBot'sf15b79968) onmain4e16bf06a; the docs commit changes no code, so the runs below on328b7e1b1hold for it. Main's #3208 moved the menu's input fromgpu/vk/vk_menu.cppintogame/crates/api/src/services/menu_input.rs, so the fix and its test were redone there (theearlier head is kept as
38126ab04): the touchpad's always-on term is out oftoggle, and the row's value 4 is thetouchpad. The row, its 13 translations and the docs are the earlier head's;
vk_api.handpad_sdl.cchange incomments only.
328b7e1b1built over the shared base (
018dd2ef40), the player's own save. At Home, the Xbox button opens and closes the menu.GL and GR were not testable: this pad's back buttons repeat another button and are not paddles of their own.
15290398c,cargo test -p apifails at "the touchpad opensnothing with the row at 0", and
tests/test_touchpad_menu.pyfails on main's four choices; both pass on the head.The Rust test also covers rows 1, 2, 3, 5 and -1, Home left to the game at row 4, and a click held while the row
changes waiting for the next click.
328b7e1b1againstmain4e16bf06a:scripts/check_host_compile.pypasses for Linux andWindows (llvm-mingw). The whole suite, strict: 878 passed, 55 failed, 13 skipped on both sides, the same files
failing; none fails only here. The generated-files check fails the same way on
main(ffi-genflagsrx_menu_openinhost/game_host.h, which this PR does not touch).game/mods/menu/test/*.test.ts(no TypeScript toolchain on this PC). CI runs them.4a88a93a5, ddb3c7a5b): the same hand test,settings.tomlsaving"touchpad", and acold review by a second agent.
Still to test:
touchpad, expecting the menu not to open. At Touchpad, expecting the click to open and close it. (@Beanstalk, or
by hand)
Measurements
Nothing to measure: the touchpad uses the existing Controller menu button handling, with no rendering, loading or cache path.
Risks
updating, at the default Home it no longer does. The PS button (Home) and Select + Start still open the menu, and
choosing Touchpad brings the click back. Where Steam Input or the OS keeps the PS button for itself, Select + Start
or the Touchpad choice is the controller's way in.
not to the menu, whatever the Controller menu button says: that setting's help already says so.
settings.tomlsaves the choice by its label ("touchpad"); an older build reads it as an unknown value and uses the default, Home.Checklist
Ready for review
main; the title is a Conventional Commit. (Onmain4e16bf06a.)mise run testpasses (any failure that also fails onmainis named). (Strict suite on Linux: the same files fail onmainthere; none only here.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (menu_inputtests andtest_touchpad_menu.py.)tests/that reads changed source is updated, not weakened. (test_touchpad_menu.pynow checksthe row's fifth choice in
mod.toml; the behaviour is in the Rust test.)mainand here, for a change that shows on screen. (The Controls tab, mainagainst this PR, taken on the old base: #3026 (comment);
the row on the ported head was checked by hand, above.)
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_01VxeaZjzGBuxjs65EH79tes
Tested in game: Windows 10, RTX 4090, Xbox-style pad, by hand: the Controller menu button row lists Touchpad; at Home the Xbox button opens and closes the menu, at Touchpad and None it does nothing
@Beanstalk on a DualSense or DualShock 4 (Windows or Linux): in play, set Controls → Controller menu button to None, then Home, and click the touchpad: the Insert menu should not open. Then set it to Touchpad: the click should open the menu and close it again.
@cuecuemoar only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was forec6e573, and the PR has changed since (4a88a93), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.Possibly related, for context:
Screenshots of the same spot, the Controls tab of the Insert menu, by hand on Windows 10 with an RTX 4090. Before: main (rt-s2721m,
468bb8d2), where Controller menu button offers None / Home / GL / GR. After: this PR (rt-s2623p, ddb3c7a5b), where the row is at the new Touchpad choice and its help names the touchpad's click.Screenshots box ticked: main against this PR, the Controls tab (comment above).
WIP: fix(input): the touchpad opens the menu only when it is the Controller menu button (#2623)to fix(input): the touchpad opens the menu only when it is the Controller menu button (#2623)ec6e5730e54a88a93a5cRebased onto
maina98cf28a2(head4a88a93a5, still two commits: the test, then the fix). Main's mod API merge (d984fd704) moved the Controller menu button row out of C++, so the fix was ported, not just merged:game/mods/interface/mod.toml; "Touchpad" and the help are added to the 13 menu languages ingame/mods/menu/strings/(machine-written translations: a native speaker's look is welcome);vk_menu.cppgates the touchpad line onsettings_now().controller_menu_button == 4;menu_settings.cppandvk_menu.hare no longer touched (the row andpad_menuleft them);manifest.jsonchange andsource-review-2623.mdare dropped: main no longer keeps source reviews;tests/test_touchpad_menu.pyis rewritten for main's code: fails ona98cf28a2atopens(NONE, HOS_PAD_TOUCHPAD), passes here.Run again on the new head: in the game by hand (Xbox-style pad, Windows 10, RTX 4090), the Linux build and the strict suite against main (identical, 45 files fail on both). Details in Testing. The DualSense run is still to do.
@Beanstalk on a DualSense or DualShock 4 (Windows or Linux), on
4a88a93a5: in play, set Controls → Controller menu button to None, then Home, and click the touchpad: the Insert menu should not open. Then set it to Touchpad: the click should open the menu and close it again.@cuecuemoar only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was for4a88a93, and the PR has changed since (38126ab), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.4a88a93a5c38126ab04eRebased onto main
5dffd615b: head38126ab04(testbc48972ba, fix38126ab04, still two commits). One conflict, the controls table in docs/user/graphics-and-controls.md (main's six new rows kept). git range-diff: the game-run code and the test are unchanged, so the hand test on4a88a93a5stands. Linux: compile check (Linux, Windows) passes; strict suite 840/53/13 on head and main, the same 53 files. Risks now names #3044's Touchpad opens Map and Pause, which takes the click when on. The DualSense farm request (comment 100716) still waits on a BigBean.@Beanstalk on a DualSense or DualShock 4 (Windows or Linux), on
38126ab04(rebased; same game code): in play, set Controls → Controller menu button to None, then Home, and click the touchpad: the Insert menu should not open. Then set it to Touchpad: the click should open the menu and close it again. Touchpad opens Map and Pause stays Off.@cuecuemoar only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was for38126ab, and the PR has changed since (dca1fdf), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.@rebase
I rebased this pull request onto
main(4007f6eae4): the new head isdca1fdfc66.Conflicts resolved
game/crates/api/src/services/menu_input/tests.rsdocs/dev/reference/input.md,docs/user/common-issues.md,game/crates/api/src/services/menu_input.rsNothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
38126ab04edca1fdfc66Recommendation: Approve. The new choice and Rust input logic address the reported behavior, but the rebased implementation has not been tested with a DualShock 4 or DualSense. The pull request also describes an older implementation and test, so its evidence needs updating. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The controller menu setting gains a Touchpad choice; at the default Home and the other choices, the touchpad click no longer independently toggles the Insert menu. This makes the setting consistent at the cost of changing the previous shortcut for PlayStation controller users.
Should fix (1): not blocking, but worth doing before merging.
Nits (1): optional.
tests/test_touchpad_menu.py:94: The test reports that the touchpad opens the menu even though it does not exercise the menu handler. (more on the line) Do: Make the success message describe the option-list check, leaving the behavioral claim to the Rust test.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
game/crates/api/src/services/menu_input.rs:554: The affected controller path has not been exercised in the game on the rebased implementation. (more on the line) Do: Run the current head with a DualShock 4 or DualSense: check None and Home do not toggle the menu, Touchpad opens and closes it, and Map and Pause is off.@fixcan do L2 and L3.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven on the affected hardware. The reported Xbox-controller run checked the row and Home behavior on an earlier implementation; no PlayStation touchpad run is reported for this implementation.
Other systems: The input path is shared across Windows and Linux and does not depend on the GPU. With Touchpad opens Map and Pause enabled, the host consumes clicks whose finger position it can read; an unreadable position remains available to the menu. The saved choice and older-build compatibility were not verified in this review.
Switches: No environment switches added, changed or removed. The player-facing Controller menu button gains Touchpad; Home remains the default.
Reviewed:
dca1fdfc66against4007f6eae4: Read the repository rules, standards and pull request template; the changed Rust input logic and its tests, the controller settings row, the Python test, the relevant host input path, and the changed documentation and header excerpts. Skimmed the translation diffs and screenshot maintenance rules. The full host C file, header, documentation files and translation files were not read in full; the adjacent Tooling checkout and docs/review-checklist.md were absent.; nothing run (a code review).Checked and fine:
Testing: No commands that build, run tests or execute project scripts were run. CI is still running; the supplied reports describe earlier-head runs.
Overlaps and merge order: The description identifies Touchpad opens Map and Pause (#3044) as an interacting feature; its merge status was not available in the supplied context.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
@ -551,9 +551,10 @@ impl Menu {1 => Some(pad::GUIDE),2 => Some(pad::LPADDLE1),3 => Some(pad::RPADDLE1),4 => Some(pad::TOUCHPAD),L1 (should fix): The affected controller path has not been exercised in the game on the rebased implementation.
When: A DualShock 4 or DualSense click must travel through SDL polling, the settings snapshot and the Rust menu handler; the reported Xbox run cannot exercise that path.
Do: Run the current head with a DualShock 4 or DualSense: check None and Home do not toggle the menu, Touchpad opens and closes it, and Map and Pause is off.
@ -91,1 +91,4 @@if choices != ["None", "Home", "Back left (GL)", "Back right (GR)", "Touchpad"]:raise SystemExit("FAIL: mod.toml: Controller menu button does not offer Touchpad as its fifth choice")print("PASS: a DualShock 4 / DualSense touchpad click opens the menu as F1, when Controller menu button is Touchpad")L3 (nit): The test reports that the touchpad opens the menu even though it does not exercise the menu handler.
When: If the Rust toggle logic is reverted while the SDL polling and option list remain intact, this Python test still prints that the touchpad opens the menu under the Touchpad choice.
Do: Make the success message describe the option-list check, leaving the behavioral claim to the Rust test.
@fix
dca1fdfc66f15b799689Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The menu now selects the touchpad only for the Touchpad choice, but the affected physical controller path has not been exercised in the game. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
f15b799689. I rebased it ontomain(14f452f810). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change adds Touchpad as a controller menu button choice and stops its click from opening the menu under the other choices. Players who previously relied on the touchpad at the default Home setting must select Touchpad.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
game/crates/api/src/services/menu_input.rs:554: The affected controller path has not been exercised in the game on the rebased implementation. When: A DualShock 4 or DualSense click must travel through SDL polling, the settings snapshot and the Rust menu handler; the reported Xbox run cannot exercise that path. Do: Run the current head with a DualShock 4 or DualSense: check None and Home do not toggle the menu, Touchpad opens and closes it, and Map and Pause is off.Checks: they run again on this head; a failure shows on the pull request.
More: does it help, other systems, switches, what was read
Does it help: Unproven: the earlier implementation passed a reported game-free test, but the current implementation has no reported DualShock 4 or DualSense game run and its current tests are pending.
Other systems: The SDL input path is shared by Windows and Linux. The Xbox-style controller run exercised Home and the new choice but could not exercise a PlayStation touchpad. The separate Touchpad opens Map and Pause setting can consume the click.
Switches: No switch added or changed by the touchpad fix. The Controller menu button setting adds Touchpad as choice 4 and retains Home as its default.
Reviewed:
f15b799689against14f452f810: Read AGENTS.md, CONTRIBUTING.md, the pull request template, tests/test_touchpad_menu.py and the menu input Rust tests in full. Reviewed the touchpad-related diff, menu input and SDL handling, and the description; skimmed standards and translation changes. The full base-to-HEAD diff includes other changes that were not reviewed in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The description reports earlier Xbox controller and game-free runs; current tests and the PlayStation controller game run are pending, and CI has not run on this head.
Overlaps and merge order: None found.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
f15b799689328b7e1b1cRedone on
main4e16bf06a: head328b7e1b1(test15290398c, fix328b7e1b1). Main's #3208 deletedgpu/vk/vk_menu.cppand moved the menu's input intogame/crates/api/src/services/menu_input.rs, where the touchpad still toggled the menu under every choice, so #2623 was still onmain. The fix is now there: the touchpad's always-on term is out oftoggle, and the row's value 4 ispad::TOUCHPAD. The test is a Rust test ofmenu_input(it fails onmainat the row at 0, passes here); the row, its translations and the docs are unchanged from the earlier head (38126ab04).Hand test on this head with an Xbox-style pad: Home opens and closes the menu. Linux: host compile passes for Linux and Windows; strict suite 878/55/13 on both sides, none failing only here. Details in Testing.
The touchpad itself still needs a DualSense or DualShock 4: the farm request above (DualSense or DualShock 4, Windows or Linux) stands, now for
328b7e1b1.@HumanBean my force-push at 19:16 replaced BeanBot's head
f15b79968(your@rebaseand@fix): I had ported the fix tomenu_input.rslocally from the earlier head and didn't see that BeanBot had done the same in the meantime. Sorry about that. I compared the two: the fix inmenu_input.rsis the same line for line, and the Rust tests here cover the same cases plus rows 5 and -1 and a click held while the row changes. What I had lost were BeanBot's two doc lines (docs/dev/reference/input.md: a click with no finger read opens the menu only at Touchpad;docs/user/common-issues.md: turn off Touchpad opens Map and Pause). They're back in10f940cee, pushed as a fast-forward. BeanBot's head is kept locally if you want it compared.@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The touchpad behavior still needs an in-game run with a DualSense or DualShock 4 on the current implementation. The reported Xbox controller run cannot exercise the affected input. Recommend approval; not approved on the forge.
The change makes the touchpad click open the menu only when Touchpad is selected as the controller menu button. It keeps Home as the default and adds a focused unit test; PlayStation controller users who relied on the old always-on behavior must select Touchpad.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
game/crates/api/src/services/menu_input.rs:554: The affected controller path has not been exercised in the game on the rebased implementation. When: A DualShock 4 or DualSense click must travel through SDL polling, the settings snapshot and the Rust menu handler; the reported Xbox run cannot exercise that path. Do: Run the current head with a DualShock 4 or DualSense: check None and Home do not toggle the menu, Touchpad opens and closes it, and Map and Pause is off.Since the last review (on
f15b799689)Still open: L1 (The affected controller path has not been exercised in the game on the rebased implementat…)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven: the reported Rust test passes on the fix and fails on the test commit, but the physical touchpad path has not been exercised in the game on this implementation.
Other systems: The SDL host supplies the touchpad bit on Windows and Linux; the menu input service consumes it. Map and Pause can consume a touchpad click before the menu sees it. The reported host compile checks cover both platforms, but there is no current physical PlayStation controller run.
Switches: Controller menu button gains Touchpad as value 4; Home remains the default. The existing saved key is unchanged. The default is consistent with the existing choice, subject to the outstanding controller run.
Reviewed:
10f940cee4against4e16bf06ab: Read the input change, its Rust and Python tests, the changed host and API comments, and available repository rules; inspected the supplied description, comments, CI and rebase comparison. The full changed host and API files, translations, generated files and remaining documentation were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that execute project code were run during this review. The author reports passing game-free tests and an Xbox controller game run; the requested PlayStation controller run remains outstanding. CI is still running.
Overlaps and merge order: None identified.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.