Preserve held-key order in GameInput keyboard readings #2715
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2717"
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 Marvisak/VIctory. Originally posted by VlREX on 2026-11-25T18:44:06Z.
The Windows keyboard source scans virtual keys numerically. Pressing W, then A while holding W, previously returned [A, W]. GetKeyState documents that newly pressed keys are appended and released entries shift out. Preserve the order of surviving keys from the last reading, using scan code and virtual key for identity. Keep the host order for keys first observed together. Regression covers adding, removing, re-pressing, and avoiding an extra sequence number when only the poll order changes. It failed before the fix and all eight fake-host GameInput tests passed locally. No hardware or game run. GetKeyState documentation.
Imported from Marvisak/VIctory. Originally posted by DrDarkDK on 2026-11-25T18:47:10Z.
#927 is still open for the same #874 fix, and the issue links a guest-facing
GetKeyStatetest of that implementation. This PR applies the ordering inState::poll, keepsHost::keysclear of the overlap with #656, and adds a useful check that a change in poll order alone doesn’t advance the reading sequence.Could we land one implementation and carry over the guest-facing test and the sequence-number check?
AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T18:51:43Z.
Matches the documented semantics: surviving keys keep their relative order from the previous reading, newly pressed keys append in host poll order (stable sort with usize::MAX position). Identity by (scan_code, virtual_key) is the right pair. The regression covers the important sequences including re-press order and the sequence-number non-bump on poll-order-only change.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:16:32Z.
Automated triage for the maintainers.
Needs rebase. This branch no longer merges cleanly into
main: the conflict is incrates/victory-hle/src/modules/gameinput.rs. No content review was done yet; it will be reviewed once it is rebased onto currentmain.Generated by Claude Code
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.