hle: VICTORY_KEYS entries can hold a key, so a scripted run can walk #3392
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3392
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3392"
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?
@pes7 on GitHub · 2026-11-26 21:40 UTC · original
pes7:feat/keys-hold→main· +21 −6 · 1 files · 1 commits · openVICTORY_KEYS=<seconds>:<key>(diagnostics builds) holds each key for 200 ms: enough for a menu press, not for walking. An entry now takes an optional third field, the hold in milliseconds:Enteris the pad's A,Wthe left stick up), with or without window focus. A run can be driven while the title's window stays in the background, and nothing steals focus from whoever uses the machine.Enterpresses and a heldW, the title reached the world with no window activation (1 862 draws/frame at 153 s).Split out of #2936 (the review there asked for its diagnostics as separate PRs).
gameinput.rsand the README's switch table only, +22/-7.Checked:
cargo clippy --workspace --all-targets -D warnings(also--all-features, which builds the diagnostics path) clean;cargo test -p victory-hle --all-features155 passed.🤖 Generated with Claude Code
VICTORY_KEYSentries can hold a key, so a scripted run can walk 5723344383`VICTORY_KEYS=<seconds>:<key>` held each key for 200 ms: enough for a menu press, not for walking. An entry now takes an optional third field, the hold in milliseconds: VICTORY_KEYS=10:Enter:300,20:Enter:300,200:W:6000 Without it the hold stays 200 ms, so existing schedules behave as before. Both the keyboard device and the stand-in pad see the keys (`Enter` is the pad's A, `W` the left stick up), with or without window focus. Co-Authored-By: Claude Opus 5.5 <[email protected]>@Dukestar69 on GitHub · 2026-11-26 21:47 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).VICTORY_KEYSentries to hold a key for a duration cleanly extends scripted input testing without affecting existing entries.cargo test -p victory-hle --lib modules::gameinput:: -- --test-threads=1: 10 passed, 0 failed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 22:08 UTC · original · approved these changes
Verified on
57233443:cargo xtask policy:191 files ok.rustfmt --edition 2024 --check: clean on the modified hunks incrates/victory-hle/src/modules/gameinput.rs.cargo clippy --locked -p victory-hle --all-targets -- -D warnings(default,--features diagnostics, and--all-features): clean.cargo test --locked -p victory-hle --lib modules::gameinput::(default and--features diagnostics): 10 passed, 0 failed.Clean, backward-compatible extension of
VICTORY_KEYS(<seconds>:<key>continues defaulting to 200 ms) with zero overhead whendiagnosticsis off.Two small non-blocking suggestions if you touch this again:
at.saturating_add(hold)instead ofat + hold(crates/victory-hle/src/modules/gameinput.rs:1322) avoids aDurationoverflow panic if a huge timestamp + hold duration is ever passed inVICTORY_KEYS.<seconds>:<key>default vs<seconds>:<key>:<hold_ms>, malformed hold fields, and[at, at + hold)timing) would cover the new syntax directly.LGTM!
@passerbyyhx on GitHub · 2026-11-26 22:32 UTC · original
Windows controlled-clock check at
5723344against63bcca4. Both revisions passed all 12 focused GameInput tests, including synthetic input cases. Across 19 exact timestamps, omitted hold stayed at 200 ms, explicit 600 ms and 100 ms holds used inclusive starts and exclusive ends, and overlapping Enter/W and W/Right were delivered together. Enter mapped to pad A and W to left stick Y=1.0.One edge case in the new parser:
18446744073709549568:W:18446744073709551615parses successfully, then the first query at elapsed zero panics atat + holdwithoverflow when adding durations. The parent skips that three-field entry.now.checked_sub(at).is_some_and(|age| age < hold)would implement the same half-open check without adding the durations.Synthetic fixture
AI-assisted with Codex.
@Jackster on GitHub · 2026-11-26 22:34 UTC · original
Windows 11,
63bcca4+ this PR, diagnostics build:cargo test -p victory-hle --features diagnostics gameinput::: 10 passed / 0 failed.cargo clippy -p victory-hle --features diagnostics --all-targets -- -D warnings: clean.No new test: the change is in the
VICTORY_KEYSparser (<seconds>:<key>[:<hold ms>]) and its doc comment, so this is compile/regression coverage only. I did not exercise a scripted run with an explicit hold — that needs the title. Synthetic only. AI-assisted.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.