Preserve held-key order in GameInput keyboard readings #2717
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!2717
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@VlREX on GitHub · 2026-11-25 18:44 UTC · original
VlREX:fix/gameinput-key-order→main· +60 −1 · 1 files · 2 commits · openThe 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.
@DrDarkDK on GitHub · 2026-11-25 18:47 UTC · original
#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.
@kotekompotek on GitHub · 2026-11-25 18:51 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 22:16 UTC · original
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
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.