Input: opt-in mouse look on the stand-in pad's right stick #2180
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T07:07:11Z.
Summary
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.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T07:17:39Z.
Review: COMMENTED
Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.
Opt-in mouse look on stand-in pad's right stick — input feature behind a flag; docs half included.
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T07:31:36Z.
On
e31ff5f, connecting a physical pad suppresses the fallback reading, but the poll still callsSource::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.
Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T08:09:15Z.
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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T12:40:31Z.
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
upstream-sync referenced this pull request2026-11-25 16:09:31 +00:00
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T19:19:55Z.
Review: APPROVED
Verified locally merged onto
origin/main(63bcca43, Windows 11 x64, Rust 1.98.1 MSVC):cargo test --locked -p victory-hle --lib modules::gameinput::— 12 passed, 0 failed (includingmouse_movement_becomes_a_clamped_right_stick_pushandmouse_pushes_the_stand_in_pad_right_stick_and_leaves_host_pads_alone)cargo clippy --locked -p victory-hle --all-targets -- -D warnings(default and--all-features) — 0 warningscargo xtask policy— ok (191 files ok)Review notes
0, negative,NaN,inf, and unparseableVICTORY_MOUSE_LOOKvalues resolve to0.0without touchingSetCursorPos, and active physical pads keepmouse_idle()resettingcentredwithout warping the cursor.focused()andwindow_centre()(crates/victory-hle/src/modules/gameinput.rs:1269, 1325) callGetForegroundWindow()separately, so a focus change between the two calls could warp relative to another window; passing the checkedHWND(and checking non-empty / non-minimized client area) plus resettingself.centred = falsewhenwindow_centre()returnsNone(1329-1331) would harden focus transitions.rustfmtline-wrapping nits atgameinput.rs:463and474.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.