Input: a key tapped between two asks is still seen at a frame a second; the scripted keys' hold can be set #1104
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1104
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1104"
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?
@Dathinel on GitHub · 2026-11-25 19:31 UTC · original
Dathinel:input/taps-between-asks→main· +21 −4 · 1 files · 2 commits · openWhat
Two small changes in
crates/victory-hle/src/modules/gameinput.rs(+13 −3) for runs at about a frame a second, which is where a 4 GB card is in the world today.Host::keysreported only keys that were down at that instant (GetAsyncKeyState(vk) < 0), so at 1 fps a normal tap, down and up inside the second between two asks, never reached the title: menus and prompts needed the key held for over a second. It now also takes the low bit ofGetAsyncKeyState(pressed since the last query), so such a tap shows as down for one ask. Still only while the title's window has focus.VICTORY_KEYS_HOLD_MS(diagnostics builds): the scripted keys ofVICTORY_KEYSare held 0.2 s; at 1 fps that falls between two asks the same way. The variable sets the hold; unset, it stays 0.2 s.Measured
RTX 3050 Laptop 4 GB, Ryzen 7 7435HS, Windows 11 26200,
--console series-s, ond510ee4with #1081 and #798 merged.cargo test --locked -p victory-hle --lib gameinput, with and without--features diagnostics: 7 passed, on this branch (dd3a14b+ this commit).VICTORY_KEYSwith Enter every 8 to 15 s, 0.2 s holds): the person at the machine had to press Enter by hand to get through the screens once the frame rate dropped.VICTORY_KEYS_HOLD_MS=1500: the run went from boot into the opening (330 s) with the same key list.Not tested
GetAsyncKeyStatecan also carry a press made just before the window took focus; I did not look for a case where that matters.AI-assisted (Claude Code). No game data attached.
@Dathinel on GitHub · 2026-11-25 20:02 UTC · original
The review's point holds: with focus away,
keys()does not query the keys, so the low bit could carry a press made in another window into the first look after focus returns. Fixed in5ea4ed5:Hostremembers whether the last look had focus, and the first look after it comes back takes only keys that are down at that instant (it still queries, which clears the stale bits). The first look of a run counts as such too.cargo test --locked -p victory-hle --lib gameinput, with and withoutdiagnostics: 7 passed; clippy onvictory-hleclean. Not tested by hand with a second window.@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 19:31 UTC · original · edited 2026-11-25 20:05 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
5ea4ed5ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 19:35 UTC · original
On
crates/victory-hle/src/modules/gameinput.rsline 1179 (outdated):On Windows, pressing and releasing Enter or Esc in another application can now generate input when returning to the title.
keys()skipsGetAsyncKeyStatewhilefocused()is false, so the low bit can retain a background press until the first focused poll. This condition then reports the already-released key as down; with no controller connected,fallback()also maps it to an A/Menu button press, potentially confirming a prompt or toggling pause merely by refocusing. Discard historical pressed bits on focus regain before accepting them as title input.Useful? React with 👍 / 👎.
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.