Input: opt-in mouse look on the stand-in pad's right stick #2182
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!2182
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2182"
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?
@denkencar-sketch on GitHub · 2026-11-25 07:07 UTC · original
denkencar-sketch:mouse-look→main· +178 −10 · 2 files · 2 commits · openSummary
Adds opt-in mouse look to the keyboard stand-in pad. With
VICTORY_MOUSE_LOOK=<sensitivity>set, mouse movement pushes the stand-in pad's right stick while the title's window has focus. The README lists "no mouse look" as missing input; this is a small step toward it.VICTORY_MOUSE_LOOK=0.05: stick push per pixel moved in one 8 ms poll (20 pixels is full tilt). Unset, zero or invalid: off, behaviour unchanged.Changes
crates/victory-hle/src/modules/gameinput.rs:Source::mouse(default: no movement),with_mouse, and the Windows host implementation (mouse_sensitivity,stick_push,window_centre).README.md: one paragraph under Input.Testing
cargo test --workspace --lockedpasses. New tests: pixel-to-stick maths and clamping, and the mouse pushing only the stand-in pad's right stick (not a connected host pad).AI-assisted.
@Dathinel on GitHub · 2026-11-25 07:31 UTC · original
On e31ff5f, connecting a physical pad suppresses the fallback reading, but the poll still calls
Source::mouse(). The Windows implementation can therefore keep callingSetCursorPoswhile the pad is in use, provided mouse look is enabled and the window has focus.I added a counter to the existing fake mouse and polled once per state: no physical pad → slot 0 connected → disconnected. Calls per poll were 1, 1, 1. Sampling only when all pad slots were empty gave 1, 0, 1 and the existing right-stick test still passed. When disabling sampling, please also reset the centering state so the first poll after unplugging the pad discards any cursor displacement.
AI-assisted Windows unit test with simulated inputs. The cursor effect follows from the Windows implementation; the test did not move the desktop cursor.
@denkencar-sketch on GitHub · 2026-11-25 08:09 UTC · original
Thanks @Dathinel, confirmed and fixed in 3b0f52d.
pollnow callsSource::mouse()only while no host pad is connected; otherwise it calls a newSource::mouse_idle(), which resets the Windows centring state so the first sample after unplugging is discarded. The existing pad test now also asserts the fake mouse is not polled while a pad is connected.cargo test -p victory-hle gameinputpasses (11 tests); not run in-game.@Marvisak on GitHub · 2026-11-25 12:40 UTC · original · edited 2026-11-26 01:24 UTC
Automated triage for the maintainers.
Merge candidate. Rebased cleanly.
VICTORY_MOUSE_LOOK=<sensitivity>adds the mouse to the stand-in pad's right stick (with_mouse,Host::mouseincrates/victory-hle/src/modules/gameinput.rs); unset, behaviour is unchanged. Following Dathinel's finding,Hub::pollnow samples the mouse only while no host pad is active (sameseen_inputrule asState::poll) and callsmouse_idleotherwise, so the cursor is not re-centred while a pad is in use; the tests cover both. Not tried in the game, as the description says.Minor: the diff also reflows a few unrelated lines in the tests and
unregister_callback; dropping those would keep it focused. #927 also adds a field tohost::Host, so whichever lands second needs a trivial rebase.CI: passing (
check).Generated by 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.