Skip to content

feat(pad): accept timed controller pulses from a local command file - #1296

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
TibixDev:pr/pad-file-input
Oct 11, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
TibixDev:pr/pad-file-input

Conversation

@TibixDev

@TibixDev TibixDev commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

What

Add optional controller input through APS5_PAD_INPUT_FILE and tools/pad_input.py. Test runs can press buttons without desktop input injection. Pulses combine with physical input and release automatically.

Related: #1076 changes the input queue. This change adds a separate input source.

Tested

Fedora 44, Release: guest_pad passes. Tests cover pulse duration, stale and invalid commands, timestamps, triggers, and physical input. Python helper checks cover button commands, release, and invalid durations.

Checklist

  • Current main; no duplicate open PR.
  • One topic.
  • No new code comments.
  • Unsupported paths still throw; UI stubs are documented.
  • No notes, logs, or images in the repository.
  • No new third-party code.
  • General behavior.
  • Depends on: none.
  • AI-assisted: yes.

@github-actions github-actions Bot added docs prx needs rebase Conflicts with main, rebase needed labels Oct 8, 2026
@TibixDev

TibixDev commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on bc1fbe81. Kept the new remote-controller and special-port checks alongside file-input coverage.

Fedora 44 Release: guest_pad_tests build; the targeted tests and contribution checks pass. Windows CI is pending.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on current main: build and the full ctest suite pass (guest_pad included), and CI is green on linux, windows and conventions. The code review found nothing blocking: the line, duration and button-mask bounds are enforced, invalid or stale commands are ignored, and the tests pin values.

@boykopovar this adds a new user-facing input interface (APS5_PAD_INPUT_FILE, tools/pad_input.py, a section in USAGE.md) that isn't covered by CONTRIBUTING, so it's a design call. Do you want a file-based injection channel in the emulator at all, or should test input go through another route? It also touches PadState.cpp, so it will need a rebase after #1076 and #1195.

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on current main after rebasing (one trivial conflict in GuestPad.cpp, both sets of checks kept): build and guest_pad pass, and the new test does not build without the change. The channel is opt-in (APS5_PAD_INPUT_FILE), bounds on line length, duration, button mask and sequence are enforced, and stale/invalid commands are ignored. Merging; whichever of this and #1076 lands second will need a rebase in PadState.cpp.

Add an optional input helper for test runs without desktop input injection. Preserve physical input and release injected buttons automatically.

Validation: guest_pad tests and Python helper CLI smoke checks passed. Written with AI assistance.
@blawesom

Copy link
Copy Markdown
Contributor

Hi! This PR currently conflicts with main, so I rebased it onto the latest main (d3e84f85, includes #3296). The only conflict was in core/libs/tests/GuestPad.cpp, resolved by keeping both main's new scePadSetVibrationMode checks and this PR's CheckInjectedState(path) call. It builds and guest_pad_tests passes locally.

If it helps, the rebased branch is available to pull:

git fetch https://github.com/blawesom/AnyPS5 rebase/pr-1296
git reset --hard FETCH_HEAD

Feel free to ignore this if you'd rather rebase yourself.

@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased onto current main after #1076 landed in PadState.cpp. The command-file buttons are now applied in both ReadState and Read (once per call, via a shared helper, to every returned state); the timestamp only changes when the pulse changes, as before. Build and 27 scoped tests pass (guest_pad included), and the new test does not build without the change. Merging once CI is green.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 11, 2026
@adriadam10
adriadam10 merged commit 4f8d401 into boykopovar:main Oct 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants