Input: report the character each held key types #656
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!656
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-656"
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?
@lameloball2813-ui on GitHub · 2026-11-24 06:21 UTC · original
lameloball2813-ui:input/keyboard-characters→main· +116 −8 · 1 files · 1 commits · openHeld keys reported code point 0 (the
shortcut:ingameinput.rs's host source). They now report the character they type, as GameInput's keyboard state does:ToUnicodeExwith the foreground window's keyboard layout, so it follows the user's layout.GetKeyState.dead_key, with the accent's spacing form as the code point. Keys that type nothing, or several characters at once, report 0.Grand Theft Auto VI reads scan codes and virtual keys only, so nothing changes for it. This fills in the platform side for titles that read characters.
Testing
Windows 11, RTX 5060 Ti. Not tested in a title (I don't have one to run).
gameinput::host: modifier sides set the generic modifier and Caps Lock sets its toggle; Space and Enter type0x20/0x0Dand F1 types nothing in the machine's layout (layout-independent keys only).cargo test --workspace: everything passes exceptvictory-loader'sload_probe, which fails before and after this change on my machine. It builds the fixture intotarget/fixturesinside the checkout, and my checkout's path is long enough thatlink.exehits LNK1104 (MAX_PATH). Unrelated to this change.cargo clippy -p victory-hle --all-targets: no warnings ingameinput.rs.cargo xtask policy: ok.Not covered: dead keys and Caps Lock have no automated test (they depend on the machine's layout and toggle state), and I haven't checked them by hand on a layout with dead keys.
@geiyiliyabumo on GitHub · 2026-11-24 11:39 UTC · original
Independent verification & code review on Windows 11 Pro (build 26100, Rust
1.98.1), cleanly merged ontomain(ffe310e):cargo xtask policy: PASS (154 files ok)cargo clippy -p victory-hle --all-targets --locked -- -D warnings: PASScargo clippy -p victory-hle --all-targets --features diagnostics --locked -- -D warnings: PASScargo test -p victory-hle --locked: 96 passed + 1 integration test (no_dll_planting), 0 failed (including neweither_sides_modifier_holds_the_generic_oneandkeys_type_their_characters)Diff review (
crates/victory-hle/src/modules/gameinput.rs): clean and thoughtful — usingToUnicodeExwith flag4(KEEP_STATE) avoids mutating keyboard dead-key state, and populating generic0x10..=0x12from sided0xA0..=0xA5ensures Shift/Ctrl/Alt modifiers work accurately.ToUnicodeExreturnsn < 0(dead key),&text[..1]covers BMP dead keys; usingn.unsigned_abs() as usize(clamped totext.len()) would also preserve a 2-unit surrogate pair if a layout ever emits a non-BMP dead-key spacing character.AI-assisted; synthetic tests only, no game files.
@molodayamama on GitHub · 2026-11-24 14:04 UTC · original
Independent Windows check of
3b001ed80c97a9da158696ae06c4961548953a53(Windows 10 22H2 19045, Rust 1.98.1, MSVC x64).cargo test -p victory-hle --locked --lib either_sides_modifier_holds_the_generic_one -- --test-threads=1 --nocapture: 1 passed.cargo test -p victory-hle --locked --lib keys_type_their_characters -- --test-threads=1 --nocapture: 1 passed.The focused checks passed for left/right modifier aliases and the characters produced from held keys.
Only source-built synthetic fixtures were used. AI-assisted verification.
@Marvisak on GitHub · 2026-11-25 01:16 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-hle/src/modules/gameinput.rs). It will be reviewed once it is rebased onto the 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.