feat: drive pads from a file with VICTORY_INPUT_LIVE #417
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!417
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-417"
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?
@jean-melikian on GitHub · 2026-11-26 18:00 UTC · original
jean-melikian:feat/input-live→main· +635 −7 · 3 files · 1 commits · draftChange
Adds an opt-in, file-driven input channel so an external tool can press buttons on the emulated pads deterministically and without
SendInput: no keystrokes are injected into Windows, and the game window does not need focus. It is meant for automated test loops (passing title/menu screens, holding a button for a known number of frames, replaying short input sequences), and for users who stream the PC (Moonlight/Sunshine/Apollo), whereSendInputwould type into whatever window is in front.VICTORY_INPUT_LIVE=<file>: the existing gameinput poll thread re-reads the file at most every 100 ms and only acts on lines appended since the previous read. Content present at start-up is ignored, a truncated file is read again from the start, and both UTF-8 and UTF-16 LE are accepted.Line format:
Example:
printf 'b:hold\n' >> live.txt, thenprintf 'release\n' >> live.txtonce the screen has changed.Holds are capped by
VICTORY_INPUT_LIVE_MAX_S(default 30) andVICTORY_INPUT_LIVE_MAX_FRAMES(default 1800), whichever is hit first.queue::frame_count(), which becomespubfor this.VICTORY_AUTO_Anever reaches a title screen that listens to the pad.gameinput: release b@… after 3.2 s, 7 frames presented (live, hold, release line). This tells whether a hold actually reached the title.Without the variable, nothing changes: no file is read and no thread is added.
Linked issue: Refs #368. It is a small first piece of the deterministic input replay discussed there, a pad-input channel driven by frame counts. It does not record or replay full pad states.
Verification
The 488 skipped tests are the ones that need the C++ runtime built locally ("runtime C++ non compilé (cmake -S runtime -B runtime/build)"), plus the GPU tests gated on it; the CI
pytestjob builds the runtime and runs them. This PR touches only Rust code underthird_party/victory, which thecargo testrun above covers.The 5 new tests:
live::tests::grammar;live::tests::apply_adds_to_a_pad;live::tests::presses_hold_end_and_log(seconds, frames, hold/release, caps) ;live::tests::a_file_made_later_counts_from_its_start;tests::live_presses_reach_a_host_pad_and_the_keyboard_without_focus, where a host pad sits in slot 0, as with a streaming host's virtual pad.They fail without the change, since the module does not exist without it.
The build emits two
victory-gpuwarnings, already onmainand not touched by this PR:host.rs:8648unused doc comment, anddescriptor/host.rs:1844left_to_drawsnever used.Runtime check: one short session on a local release build (RTX 3080 Ti, driver 621.24 (32.0.16.2124), Windows 11) with an external pilot script appending lines to the file. The log shows the press reaching the gameinput path and its frame count:
gameinput: live press [email protected]:0.3, thengameinput: release [email protected] after 0.3 s, 9 frames presented (live, 0.3 s).hold/releaseand frame-counted durations are covered by the unit tests only so far. No game files are involved in the tests.Oracle and test data
Unit tests only, with no title data: they build pad states and input files in a temporary directory. Failure case: without this change,
VICTORY_INPUT_LIVEis ignored and no press reaches a pad.Checklist
E_NOTIMPL), never a fake success. (No new emulated function.)AI assistance: this change was written with AI assistance (Claude); it was reviewed and tested as described above.
🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.