Input: the mouse as the keyboard pad's right stick and triggers, with a PC key layout (VICTORY_MOUSE=1, off by default) #153
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!153
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-153"
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?
@mavis140 on GitHub · 2026-11-26 08:10 UTC · original
mavis140:mouse-look→main· +374 −17 · 3 files · 1 commits · closed without mergingWith no pad connected the keyboard is the title's pad and the camera sits on I/J/K/L, which makes a
third-person title hard to steer. With
VICTORY_MOUSE=1the mouse becomes part of that stand-in pad:its travel is the right stick, its buttons are the triggers, and the keys are laid out after GTA V's
keyboard and mouse controls (W A S D, Shift to sprint, Space, F, R, Q, Tab, Ctrl, C, V). Unset, nothing
changes: the existing key table, its README entry and its test are untouched. No issue or PR here or upstream covers mouse input (searched both).
What is in it (one commit, 374 lines, 104 of them tests and docs)
crates/victory-hle/src/modules/gameinput.rsLook: mouse travel paid out as a stick deflection over 45 ms, so a whole movement arrives and thestick comes to rest; a deflection starts above the share a title ignores around the middle
(
VICTORY_MOUSE_SPEED, default 1400 px/s for a full stick;VICTORY_MOUSE_DEAD, default 0.12).MOUSE_BUTTONS: the second key table (Shift A, Space X, F Y, R B, Tab / Q shoulders, Ctrl / Cstick clicks, V View, Esc / P Menu), used only with the switch on.
a pad has one set of buttons for both and a title does not say which it is at.
focus; F8 lets it go and takes it again; losing focus lets it go.
crates/victory-hle/src/modules/lifecycle.rs: no pointer over the picture while the mouse is held(
WM_SETCURSORin the window procedure that is already hooked).docs/README-fxceless.md: the key table for the mode and its three variables.Tested
Windows 11 build 26200, title on an NVMe SSD; Rust 1.98.1 (the pinned toolchain),
diagprofilewith
--features diagnostics, onmainat39031cb.cargo test -p victory-hle --locked: 154 passed, 0 failed, 2 ignored (lib), plus 1 + 1 passed inthe two other test binaries. Three tests are new: the two layouts side by side, the driving layout,
and that 300 pixels of travel pay out 300 and leave the stick at rest.
cargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warnings, and the same with--all-features: no finding in the two changed files. (The workspace-wide CI lint does not get thisfar on
maintoday:victory-gpuhas 31 findings anddstorage.rs4, none from this change.)the switch: the camera follows the mouse naturally, the
left and right buttons fire and aim, the keys behave like GTA V's keyboard and mouse controls, and the
pointer stays hidden over the picture.
Not tested
by unit tests only), and the final build with
VICTORY_MOUSE=1set (the session above ran the same codewith the mode always on).
user32, but untried there), a real pad connected at the same time as the mouse.
will want a different key for it.
AI use
The in-title check was done by hand by the submitter.
🤖 Generated with Claude Code
Pull request closed