Input: PC keyboard and mouse (VICTORY_MOUSE_LOOK, VICTORY_BINDS=rockstar) and key caps over the button prompts (VICTORY_PROMPTS=keys) #455
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!455
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-455"
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?
@Jesper-Andersson on GitHub · 2026-11-27 10:34 UTC · original
Jesper-Andersson:pc-input→main· +4350 −78 · 20 files · 5 commits · openNo issue asks for this (searched upstream issues for mouse, keyboard, keybind, prompts, glyph and similar: nothing), so there is no
Fixes #.With no gamepad, the keyboard drives a stand-in pad (
crates/victory-hle/src/modules/gameinput.rs), but the mouse does nothing, the layout is not one a PC player knows, and every prompt shows a gamepad button. This PR adds three opt-in switches, all off by default; with none of them set the input path and prompts are as on main.Change
VICTORY_MOUSE_LOOK=1: raw mouse travel (WM_INPUT, unaccelerated, read on a message-only window in its own thread) becomes the stand-in pad's right stick: smoothed over about 30 ms, lifted past the stick's dead zone so slow aiming moves, at rest within about 90 ms of the mouse stopping (Lookingameinput.rs). While the title's window has focus the pointer is clipped to its centre and hidden (WM_SETCURSORinlifecycle.rs); F8 lets it go and takes it again, and losing focus lets it go. Mouse buttons play only while the pointer is held, and only after all were up once (the click that focuses the window does not fire). Tuned byVICTORY_MOUSE_SENS(default 1: 1000 counts a second is a full deflection),VICTORY_MOUSE_INVERT=1andVICTORY_MOUSE_DEAD(default 0.2).VICTORY_BINDS=rockstar: GTA V's PC default keys on GTA V's pad layout, with an on-foot and a driving layout. F (enter or leave a vehicle, the pad's Y) switches layouts; F7 switches without pressing Y, for when the two get out of step.classic(or unset) is the old table, unchanged. The bind tables move tocrates/victory-core/src/pad.rs, so input and prompts read the same table.VICTORY_PROMPTS=keys(Series 1.0.2.1 only): key caps over the title's button prompts. When the streaming store hands over the icon movie, a copy is redrawn in memory (crates/victory-game/src/prompts.rs,prompts/hook.rs): each known icon becomes a white key cap with the key that the bind table in force gives that control, outlined at run time from the host's Segoe UI through GDI (prompts/font.rs). The title is answered with the copy's address when it loads that movie. A control without a key keeps its picture. The movie is recognised by its structure (class names ending in icon numbers, still sprites of shapes); nothing of the game is stored, and the tests use hand-built movies. This is a port of imjustprism's Marvisak/VIctory#3433 (its loader helpers and Scaleform reader are picked as they are, authorship kept); changes to it: the keys come fromVICTORY_BINDSinstead of a fixed table, labels for Space, Shift, Ctrl and mouse buttons, an environment switch instead of--prompts keys.VICTORY_MOUSE_DEVICE=1(diagnostic): also reports a GameInput mouse device, and the log names each input kind the title asks for once (title asks for input kind).KNOWN_BUILDSgets its first entry, Series 1.0.2.1 (BLAKE3 of the executable) with the two hook offsets from #3433 (a pointer slot and a function), asdocs/asset-policy.mdallows.The rockstar binds
Findings
0x10) and gamepad (0x40000) input kinds, never mouse (0x20) (thetitle asks for input kindlog line, once per kind asked), also in a run withVICTORY_MOUSE_DEVICE=1reporting a mouse device into the world. So it has no mouse path of its own to feed: mouse look has to go through the right stick, and its prompts can only be pad pictures, unless we draw key caps over them.Where it does nothing
Binds::Classicis the oldFALLBACK_BUTTONStable (testclassic_binds_are_the_old_table), no mouse is read, no mouse device is reported (testthe_mouse_device_reports_summed_travel_when_switched_on, off case), and no hook is placed.VICTORY_PROMPTS=keyson another build: nothing is placed, and the run saysprompts gamepad pictures: the keys need a known build. A movie that is not the icon movie, or one with parts the reader cannot read, is passed through unchanged (tests inprompts.rs).Checks
cargo test --locked -p victory-hle --lib gameinput: 13 passed (5 new: classic table, rockstar layouts and the F/F7 switch, mouse travel to stick and back to rest, mouse look only while captured, the mouse device); the same with--all-features: 13 passedcargo test --locked -p victory-core: 17 passed (pad: 4 new)cargo test --locked -p victory-game: 40 passed (prompts: 37 new, on hand-built movies and a host-font check)cargo test --locked -p victory-formats --lib gfx: 18 passed (new)cargo test --locked -p victory-loader: all passed (52 unit,load_probewith the new pointer-slot checks)cargo check --locked -p victory: okcargo clippy --locked --all-targets [--all-features]on victory-core, -formats, -loader, -game, -hle, victory: no warnings in changed code (the existing ones on main are invictory-loader/src/descriptor_sites.rsandvictory-gpu)cargo xtask policy: 277 files okIn game: unattended runs on a local branch (RTX 2070 SUPER, Series S + DLSS) with all three switches: the log showed raw mouse input on, the pointer captured,
prompts: key caps drawn into the icon movieandprompts: the title loads the icon movie with key caps, and no crash. Then a play session of about 17 minutes by hand with all three on (mouse look, rockstar binds, key caps). Those runs were on a local branch with other changes; this branch is these commits alone on main.Not checked
85df3e0b, a ray-tracing resolve pass, in the ocean area) was first used. Looked at since: that shader is an ordinary wave32 program without group-shared memory, its 12 s driver build was like nine others just before, the reason given wasDXGI_ERROR_DEVICE_REMOVEDwith nothing of ours running on the card, and the card's memory was at its budget then. So it looks like memory pressure or the driver, not input; not proven, and not ruled out on this branch.Related
Co-authored-by).VICTORY_KEYBINDS); trustno1-coder/VIctory-NVIDIA#9 (merged, a GameInput mouse device from cursor deltas; per the finding above the title does not read one here). No open upstream PR covers any of this.This change was made with AI assistance (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.