feat(pad): let controller timelines hold stick positions #16097
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16097"
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 LeandroLP23 on 2026-11-05T16:46:36Z.
What
A controller timeline (
APS5_PAD_INPUT_FILE,tools/pad_timeline.py) could only press buttons, while a single pulse can already set the four stick axes. Titles whose menus move only with the left stick cannot be driven by a timeline. SuperTuxKart (PPSA69421) is one: itsinput.xmlbindsmenuUp/Down/Left/Rightto axes 0 and 1 andmenuSelectto button 0, so d-pad presses do nothing in its menus.InputCommandFile.hpp): a timeline row may bestart duration buttonsorstart duration buttons lx ly rx ry, the same axis order and 0..255 range as a pulse. While the row is active its axes replace the physical sticks; rows without axes keep them as before. The row is split with the separators the numeric extraction accepted before (whitespace, or a+sign starting the next number), so existing timelines such as0+500+16still parse.pad_timeline.py: events may holdleft_stickand/orright_stickas[x, y]; an event naming one stick writes the other centred (128). Unknown event fields are still rejected.pad_input.py(reading an existing timeline for the next sequence) andpreview_pad_timeline.pyaccept the 7-column rows; the preview shows both sticks.INPUT_MAPPING.mddocuments the fields.Tested
pad_command_file_tests(InputCommandFile.cpp) with the new cases passes. Built againstmain's header, the same test fails (input command assertion failed). The new cases: a stick row followed by a button-only row, rows with 4, 6 and 8 columns, an axis of 256 and a non-numeric axis are all refused, and a+-joined 7-column row is accepted.python -m unittest tools.tests.test_pad_timeline tools.tests.test_pad_input tools.tests.test_preview_pad_timeline: 64 pass (3 skipped as onmain). New cases cover stick rows, position validation (missing, extra, out of range, bool and float axes), unknown event fields, and sequence handling of stick rows inpad_input.py.main4741457fedwith this header: a timeline{"at_ms":0,"hold_ms":400,"buttons":[],"left_stick":[255,128]}sent to SuperTuxKart moves its tutorial dialog's focus from "No" to "Yes" (dumped frames), which button-only timelines could not do. A temporary log inscePadReadStateshowed the title reading port 0 with the injected buttons andconnected=1.python tools/check_conventions.py --base origin/mainpasses.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)tools/tests/test_pad_timeline.py, and #11360 changespad_input.py's error reporting, not its timeline parsing; whichever lands second rebases.