Input: keyboard and mouse played like a PC game (rebindable [controls]) #1529
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!1529
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1529/head"
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?
@claude-GTA6 on GitHub · 2026-11-24 18:49 UTC · original
claude-GTA6:pr-pc-controls→main· +1807 −60 · 10 files · 4 commits · closed without mergingFrom a tester working with Claude (AI-assisted); measured on my own machine.
What
Keyboard and mouse played like a PC game, not only the fixed stand-in pad.
The title registers device callbacks for Gamepad (0x40000) and Keyboard (0x10) only, never Mouse (0x20), so there is no mouse path in the title. The keyboard and mouse therefore act as a pad: on the first connected host pad, or on the stand-in pad when none is connected.
WM_INPUTon a message-only window of its own thread, so no pointer acceleration and no Windows setting involved) becomes the right stick. The title reads its stick as a turn rate, so the counts since its last pad read are divided by the time since that read, at that read (current_readingfor a gamepad makes the reading). The same hand movement turns the same angle at any frame rate.stick_deadzone/stick_curveundo the title's own stick shaping (defaults 0 / 1, not calibrated yet). A flick past full stick is turned in full a little later (at most 100 ms of carry). Reads less than 2 ms apart see the same value.WM_SETCURSOR) and held in the client area (ClipCursor) while the title window has focus. Alt-Tab (focus loss) or Esc frees it, a click or Esc captures it again. Mouse buttons held at the moment of capture are not passed on until they are released, so the click that captures is no shot.[controls]invictory.toml. Sensitivity, y scale, invert, capture, carry, dead zone, curve, walk speed, and[controls.on_foot]/[controls.vehicle]rebinding (one output, a list, or""to unbind). Unknown keys, outputs and fields are errors at start.enabled = falsekeeps the old stand-in pad exactly as before. Seevictory.example.tomland the README's input section.VICTORY_KBM=<s>:<key>[*<hold>],<s>:MouseX=<counts>[*<hold>],<s>:Wheel=<n>plays input into this layer without touching OS input.VICTORY_LOG=victory_hle::modules::gameinput=debuglogs each pad state the title reads when it changes.New file
crates/victory-hle/src/modules/controls.rs(plain data, no Windows calls; the unit tests live there).gameinput.rsfeeds it from the poll thread and drains it on title reads;lifecycle.rs's window hook handles the cursor;victory-core's config passes the[controls]table through.Sourceonly gains a defaultedmouse_buttons(), so the pad-source PRs (#150, #312) should stay mergeable. #1517 (DualSense) movesgameinput.rsinto a folder, so whichever of the two lands second needs a rebase; the controls layer itself is independent of it.An AI tool wrote this change.
Tested
cargo test --workspace --locked358 passed, 0 failed;cargo clippy --workspace --all-targets --locked -- -D warningsclean;cargo xtask policy: ok.controls.rs(WASD + walk, buttons/triggers, vehicle layout, sub-frame taps, wheel pulses, counts to rate, slow frames, close reads, dead zone/curve/invert, flick carry, pad drift vs mouse, config rebinding and refusals) and 3 ingameinput.rs(the stand-in pad without a host pad, riding on a connected host pad, a title read carrying the mouse motion).VICTORY_KBMscript, title-read log): every scripted input reached the pad the title read (device 0): Enter -> A on the start screen, W -> left stick +1,MouseX=2000over 1 s -> right stick +1.0, Space -> X with right mouse -> LT 1.0, wheel -> one D-pad press and release, Tab -> LB, a fast left flick -> -1.0 then -0.4 (carry) then 0. The world was loaded but ran at 0.5-0.8 fps, so the title read the pad only every 1-2 s. Presses made between reads arrived latched in the next read (Esc, Right, Right, Left -> one read with Menu+Left+Right). Short stick holds between reads are missed, which is expected for sticks. This is also why the longest span is 1 s: with 250 ms the rate came out 4x too high on these frames.🤖 Generated with Claude Code
@claude-GTA6 on GitHub · 2026-11-25 01:06 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
Merged current
main(42363ab6) as08bed55f; it conflicted inREADME.mdandgameinput.rs. Both sides are kept:main's scripted keys (64484b42) are applied to the host pads first, then the keyboard and mouse layer rides on the first connected pad or the stand-in.Sourcehas bothscripted_keysandmouse_buttons.main'sVICTORY_WINDOW_MAXparagraph plus the input section.Windows 11 / RTX 5090:
cargo test --workspace --locked --exclude victory-shader --exclude victory-gpu327 passed, 0 failed (the two GPU crates don't touch input and were left out because the GPU was busy). Clippy-D warningsonvictory-hle,victory-coreandvictoryis clean;cargo xtask policyok. One note unrelated to this PR:dstorage::tests::a_page_list_filled_after_its_request_startsis timing-flaky here on a loaded machine (it fails about 2 of 4 runs alone;dstorage.rsis identical tomainon this branch).@Marvisak on GitHub · 2026-11-25 03:29 UTC · original
Automated triage for the maintainers.
Needs work: needs the maintainer's decision. This is a large input feature:
modules/controls.rs(1,083 lines), raw mouse input on its own thread ingameinput.rs, cursor capture inlifecycle.rs::window_proc, and a[controls]table read throughvictory-core's config. It addsserdeandtomlas dependencies ofcrates/victory-hle/Cargo.tomland changesCargo.lock, which needs the maintainer's decision. The diagnosticVICTORY_KBMscript is gated behind thediagnosticsfeature, which is good. The description says the button mapping follows another title's console layout and is unverified for this one, and mouse feel and play in a focused window are untested. #1517 touchesgameinput.rsas well, so one of the two will need a rebase. No CI ran. What would help: the maintainer's decision on the dependencies and scope, and evidence for the button meanings.Generated by Claude Code
Pull request closed