trainer: keep RB + D-pad Left free for the radio (#3055) #3075

Open
DIGITALWORLD-PL wants to merge 1 commit from upstream-pr/3075 into main
DIGITALWORLD-PL commented 2026-12-02 09:18:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DIGITALWORLD-PL on 2026-12-02T09:18:29Z.


Claimed in the coordination issue as: D3D12-MENU-PAD-RADIO-BIND

Fixes #3055.

What changed

Holding D-pad Left and pressing RB to change radio stations also toggled the trainer. The new shortcut is hold LB and RB on one XInput controller, then press View (Back). Buttons on different controllers cannot complete the chord. View avoids reusing B and D-pad Down, which already navigate the trainer. F4 remains the keyboard shortcut.

When GameInput reads the full chord on a controller, it withholds that View press until View is released, even if a bumper is released first. A separate View press still reaches the game. With the trainer disabled, the full chord passes through.

Tested

Windows, Rust 1.98.1 MSVC. Base: a917c54d6.

  • With the new menu sequence test on the old mapping, the test failed when RB was added to the held D-pad Left. With the fix, the trainer stays closed for that sequence, opens once while the new chord is held, and closes on the next press.
  • All 50 unit tests passed with cargo test --locked --offline -p leonida-menu.
  • The selected GameInput test passed with cargo test --locked --offline -p leonida-hle --lib host_pads_convert_to_console_pads.
  • All 57 documentation checks passed, as did git diff --check and the changed-file game-data scan.

GPUs tested: n/a. These are CPU tests with synthetic input. An in-game check with a physical controller would confirm station selection and map behavior.

AI-assisted: OpenAI Codex (GPT-6.2 Astra), with an independent read-only review of the final diff by GPT-6.2 Sol.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5603462963 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3075). Originally posted by [DIGITALWORLD-PL](https://github.com/DIGITALWORLD-PL) on 2026-12-02T09:18:29Z. --- Claimed in the coordination issue as: [D3D12-MENU-PAD-RADIO-BIND](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7339996492) Fixes #3055. ### What changed Holding D-pad Left and pressing RB to change radio stations also toggled the trainer. The new shortcut is **hold LB and RB on one XInput controller, then press View (Back)**. Buttons on different controllers cannot complete the chord. View avoids reusing B and D-pad Down, which already navigate the trainer. F4 remains the keyboard shortcut. When GameInput reads the full chord on a controller, it withholds that View press until View is released, even if a bumper is released first. A separate View press still reaches the game. With the trainer disabled, the full chord passes through. ### Tested Windows, Rust 1.98.1 MSVC. Base: a917c54d6. - With the new menu sequence test on the old mapping, the test failed when RB was added to the held D-pad Left. With the fix, the trainer stays closed for that sequence, opens once while the new chord is held, and closes on the next press. - All 50 unit tests passed with `cargo test --locked --offline -p leonida-menu`. - The selected GameInput test passed with `cargo test --locked --offline -p leonida-hle --lib host_pads_convert_to_console_pads`. - All 57 documentation checks passed, as did `git diff --check` and the changed-file game-data scan. GPUs tested: n/a. These are CPU tests with synthetic input. An in-game check with a physical controller would confirm station selection and map behavior. AI-assisted: OpenAI Codex (GPT-6.2 Astra), with an independent read-only review of the final diff by GPT-6.2 Sol.
Kal0s-design commented 2026-12-02 10:23:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T10:23:13Z.


Windows 11, MSVC toolchain 1.98.1. Head 6ebaa2cba merged into current main 80910637f: the merge is clean. The description ran one leonida-hle test, so here are the whole crates:

  • cargo test -p leonida-menu --locked: 50 passed, 0 failed.
  • cargo test -p leonida-hle --lib --locked: 248 passed, 0 failed, 2 ignored. That includes host_pads_convert_to_console_pads.
  • cargo test -p leonida-gpu --lib trainer: 4 passed.
  • cargo clippy -p leonida-menu -p leonida-hle --lib --tests: no warning in leonida-menu or gameinput.rs.

One thing I noticed in PadShortcut::for_title, by reading the code, not on a pad: View is kept from the title only from the frame the full chord is seen. Press View first and then the two bumpers, and that first View frame reaches the game, which opens the map, while the trainer toggles once the bumpers are down. With the order the docs give (bumpers, then View) nothing leaks. The new test covers that order. If you want either order to work, the View press would have to be held back while one bumper is down. That's your call, and it's fine to leave it as documented.

Not checked: a physical controller in game.

GPUs tested: n/a (CPU unit tests)

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7342392984 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3075#issuecomment-7342392984). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T10:23:13Z. --- Windows 11, MSVC toolchain 1.98.1. Head `6ebaa2cba` merged into current `main` `80910637f`: the merge is clean. The description ran one `leonida-hle` test, so here are the whole crates: - `cargo test -p leonida-menu --locked`: 50 passed, 0 failed. - `cargo test -p leonida-hle --lib --locked`: 248 passed, 0 failed, 2 ignored. That includes `host_pads_convert_to_console_pads`. - `cargo test -p leonida-gpu --lib trainer`: 4 passed. - `cargo clippy -p leonida-menu -p leonida-hle --lib --tests`: no warning in `leonida-menu` or `gameinput.rs`. One thing I noticed in `PadShortcut::for_title`, by reading the code, not on a pad: View is kept from the title only from the frame the full chord is seen. Press View first and then the two bumpers, and that first View frame reaches the game, which opens the map, while the trainer toggles once the bumpers are down. With the order the docs give (bumpers, then View) nothing leaks. The new test covers that order. If you want either order to work, the View press would have to be held back while one bumper is down. That's your call, and it's fine to leave it as documented. Not checked: a physical controller in game. GPUs tested: n/a (CPU unit tests) AI-assisted: yes (Claude Code).
lixonik commented 2026-12-02 11:15:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T11:15:04Z.


Verified locally on Windows 10 x64, PR head 6ebaa2cba merged cleanly onto main a252854a2:

  • Unit tests:
    • cargo test -p leonida-menu --locked -- 50 passed, 0 failed (including app::tests::radio_controls_leave_the_menu_closed_and_the_view_chord_toggles_once).
    • cargo test -p leonida-hle --locked --lib gameinput -- 50 passed, 0 failed.
  • Clean-room check: python -I scripts/check_no_game_data.py on all 8 touched files -- exit 0.
  • Code review: moving the trainer toggle chord from RB + D-pad Left to LB + RB + View frees the in-game radio control cleanly, and PadShortcut::for_title tracks captured_view per XInput slot until PAD_VIEW is released (resetting on disconnect in gameinput.rs:1587) so opening/closing the trainer does not leak a View press to the title's map.

Result: PASS.

AI-assisted: yes (Antigravity).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7343645319 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3075#issuecomment-7343645319). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T11:15:04Z. --- Verified locally on Windows 10 x64, PR head `6ebaa2cba` merged cleanly onto `main` `a252854a2`: - **Unit tests:** - `cargo test -p leonida-menu --locked` -- **50 passed, 0 failed** (including `app::tests::radio_controls_leave_the_menu_closed_and_the_view_chord_toggles_once`). - `cargo test -p leonida-hle --locked --lib gameinput` -- **50 passed, 0 failed**. - **Clean-room check:** `python -I scripts/check_no_game_data.py` on all 8 touched files -- exit `0`. - **Code review:** moving the trainer toggle chord from `RB + D-pad Left` to `LB + RB + View` frees the in-game radio control cleanly, and `PadShortcut::for_title` tracks `captured_view` per XInput slot until `PAD_VIEW` is released (resetting on disconnect in `gameinput.rs:1587`) so opening/closing the trainer does not leak a `View` press to the title's map. Result: **PASS**. AI-assisted: yes (Antigravity).
MoonEyes commented 2026-12-02 18:00:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:00:21Z.


Triage of head 6ebaa2cba (merge base a917c54d6, 184 commits behind; git merge-tree against current main 45dc41f95: no conflicts).

8 files in leonida-menu, leonida-hle/gameinput.rs, trainer.rs and docs (+86/-17).

CI is at action_required on this head (fork workflow approval).

Existing verification: Verified on this head by @Kal0s-design (leonida-menu 50 passed, leonida-hle --lib 248 passed, clippy clean) and @lixonik (leonida-menu 50 passed, gameinput 50 passed, clean-room exit 0). Nothing pushed since.

This check: Read the diff: the trainer chord moves from RB + D-pad Left (which collides with the radio) to LB + RB + View on one XInput pad, and GameInput withholds that View press while the chord is held so the title does not also see a Back press. d3d12/README.md and docs/mod-menu.md are updated to the new chord in the same PR.

I did not build it: the crate is Windows-only (or the C++ runtime's Windows build), so no red/green was run here.

Verdict: ready (fixes #3055, verified twice on this head; needs CI approval).

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353852435 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3075#issuecomment-7353852435). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:00:21Z. --- **Triage of head `6ebaa2cba` (merge base `a917c54d6`, 184 commits behind; `git merge-tree` against current `main` `45dc41f95`: no conflicts).** 8 files in `leonida-menu`, `leonida-hle/gameinput.rs`, `trainer.rs` and docs (+86/-17). CI is at `action_required` on this head (fork workflow approval). **Existing verification:** Verified on this head by @Kal0s-design (`leonida-menu` 50 passed, `leonida-hle --lib` 248 passed, clippy clean) and @lixonik (`leonida-menu` 50 passed, `gameinput` 50 passed, clean-room exit 0). Nothing pushed since. **This check:** Read the diff: the trainer chord moves from RB + D-pad Left (which collides with the radio) to LB + RB + View on one XInput pad, and GameInput withholds that View press while the chord is held so the title does not also see a Back press. `d3d12/README.md` and `docs/mod-menu.md` are updated to the new chord in the same PR. I did not build it: the crate is Windows-only (or the C++ runtime's Windows build), so no red/green was run here. **Verdict: ready** (fixes #3055, verified twice on this head; needs CI approval). AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-12-02 23:49:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T23:49:15Z.


VERIFY-3075 — Windows nativo: red then green en leonida-menu, y el control falló primero por mi culpa

Own commit 6ebaa2cba — the trainer chord moves from RB + d-pad Left to LB + RB + View, with PadShortcut in leonida-menu/src/input.rs

Ran at the head

cargo test -p leonida-gpu --lib trainer      4 passed
cargo test -p leonida-menu                  50 passed

Negative control, in two attempts and the first was mine: I made PadShortcut::for_title return the buttons unchanged (never withholding View) and ran -p leonida-gpu --lib trainer → 4 passed. Wrong crate — PadShortcut lives in leonida-menu, so the test that drives it does not run under leonida-gpu. Re-ran:

cargo test -p leonida-menu     FAILED. 49 passed; 1 failed
  the_radio_and_map_reach_the_title_but_the_trainers_view_press_does_not

It bites, and the test is the one that makes the change safe.

What the change is, and why RB + d-pad Left had to go: d-pad Left is a radio control on XInput pads — the trainer chord stole a control the game needs, which is what the title says. The new chord is LB + RB + View, and the dangerous half is View: it opens the game's map, so the press that opens the trainer would also open the map. PadShortcut tracks each XInput slot separately, withholds View from the title while the chord is held, and releases it when View is released — "a separate View press reaches the game as usual".

And the test is written as a sequence in time, not a single predicate: radio_controls_leave_the_menu_closed_and_the_view_chord_toggles_once walks PAD_LEFT, PAD_LEFT|PAD_RB, bumpers, bumpers|PAD_VIEW, release… which is the only way to test a chord that must remain "captured" after its buttons change.

What I could not test

  • A real XInput pad: the tests feed button words through the same path the pad fills.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7362465141 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3075#issuecomment-7362465141). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T23:49:15Z. --- ## VERIFY-3075 — Windows nativo: `red then green` en `leonida-menu`, y el control falló primero por mi culpa | | | |---|---| | Own commit | `6ebaa2cba` — the trainer chord moves from **RB + d-pad Left** to **LB + RB + View**, with `PadShortcut` in `leonida-menu/src/input.rs` | **Ran at the head** ``` cargo test -p leonida-gpu --lib trainer 4 passed cargo test -p leonida-menu 50 passed ``` **Negative control, in two attempts and the first was mine**: I made `PadShortcut::for_title` return the buttons unchanged (never withholding View) and ran **`-p leonida-gpu --lib trainer` → 4 passed**. **Wrong crate** — `PadShortcut` lives in `leonida-menu`, so the test that drives it does not run under `leonida-gpu`. Re-ran: ``` cargo test -p leonida-menu FAILED. 49 passed; 1 failed the_radio_and_map_reach_the_title_but_the_trainers_view_press_does_not ``` **It bites**, and the test is the one that makes the change safe. **What the change is, and why RB + d-pad Left had to go**: **d-pad Left is a radio control on XInput pads** — the trainer chord **stole a control the game needs**, which is what the title says. The new chord is **LB + RB + View**, and the dangerous half is **View**: it opens the game's map, **so the press that opens the trainer would also open the map**. `PadShortcut` **tracks each XInput slot separately, withholds View from the title while the chord is held, and releases it when View is released** — *"a separate View press reaches the game as usual"*. **And the test is written as a sequence in time**, not a single predicate: `radio_controls_leave_the_menu_closed_and_the_view_chord_toggles_once` walks `PAD_LEFT`, `PAD_LEFT|PAD_RB`, `bumpers`, `bumpers|PAD_VIEW`, release… **which is the only way to test a chord that must remain "captured" after its buttons change.** ## What I could not test - **A real XInput pad**: the tests feed button words through the same path the pad fills. Written with an AI assistant.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3075:upstream-pr/3075'
git switch 'upstream-pr/3075'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3075'
git switch 'upstream-pr/3075'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3075'
git switch 'upstream-pr/3075'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3075'
git switch 'main'
git merge --squash 'upstream-pr/3075'
git switch 'main'
git merge --ff-only 'upstream-pr/3075'
git switch 'main'
git merge 'upstream-pr/3075'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!3075
No description provided.