feat(tools): press several buttons together from pad_input.py #9079
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9079"
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?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T11:55:50Z.
What
Some titles wait for a chord: RollerCoaster Tycoon Adventures Deluxe (PPSA17330) asks for L1 + R1 on its title screen. The pad command file already carries a button bit field, but
tools/pad_input.pyaccepted only one button name, so a scripted test could not get past that screen.+, such asl1+r1, are combined into one command and pressed together for the same hold time.releaseinside a chord are reported as argument errors (exit code 2) without touching the command file.docs/user/USAGE.mdlists the form.Tested
Linux 7.2.9, Python 3.
python3 -m unittest tests.test_pad_inputintools: 14 tests pass.pad_input.py:l1+r1gives0x400 | 0x800, andcross+square+upwith--hold-ms 40keeps the hold and advances the sequence;b5d763770a:0xc00, written in this format) reached the play-mode menu and the tutorial park (discussion #9078).#6531 changes other lines of the same file (path validation and output encoding); the two do not overlap.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T14:08:23Z.
Review: APPROVED
Verified on Windows 11, Python 3.14, merged onto main
80565c594:python -m unittest tests.test_pad_input(tools/): 14 run, 2 skipped (POSIX-only permission tests), rest pass. Same at the PR head.tests.test_pad_timelinealso passes, since it importsBUTTONS/next_sequencefrom this module.pad_input.pyswapped in, the new tests fail (1 error intest_joined_buttons_are_pressed_together, 5 failing subtests intest_invalid_joined_buttons_report_error_and_preserve_command), so they cover the change.l1+r1writes mask 3072 (0xC00),releasestill writes 0, andL1+r1exits 2 with the "invalid button" message.InputCommandFile.hppreads the button field as one integer and only rejects bits outside0x10fffe | TouchLeftBit | TouchRightBit, so every OR ofBUTTONSvalues is accepted. The file format is unchanged, and the existing C++ test already uses a multi-bit mask (0x4800).python tools/check_conventions.py --base main: all checks passed.choices=gone,--helpno longer lists the button names. They still appear in the error message.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T16:11:19Z.
Addressed the help-text nit in
ba09143027:--helplists every button name again, keeps thel1+r1example, and states thatreleasemust be used alone. Input parsing is unchanged.Linux validation:
python3 -m unittest tests.test_pad_input tests.test_pad_timelineintoolspasses all 30 tests; convention checks pass againstorigin/main. The updated branch merges cleanly with maincecb540a63. No additional Windows run is claimed.Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T17:56:50Z.
Review: APPROVED
Rechecked
ba0914302merged onto main950388bfdon Windows 11:--helplists every button name again with thel1+r1example and the note thatreleasemust be used alone, andtests.test_pad_input/tests.test_pad_timelinepass (3 POSIX-only skips).Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-21T18:51:17Z.
Review: APPROVED
Reviewed at
ba0914302on Windows 11, Python 3.11.9, with both commits cherry-picked onto mainf894ba69d300. No blocking findings.InputCommandFile.hpp(identical on main and this PR). All 174 Python-generated commands round-trip correctly: every button pair, single buttons, an all-button chord and a three-button chord, with hold/release timing, sticks and touchpad flags checked.The #6531 overlap concerns adjacent argument/path validation and output encoding, rather than another chord implementation; both validations need to be retained when combining those changes.
No game, physical controller, Linux/POSIX permissions or full native project build was tested. The native check above exercises the file reader only.
AI-assisted: yes (Codex); all results above were run locally.