Repository navigation
Input: opt-in mouse look on the stand-in pad's right stick - #2182
denkencar-sketch wants to merge 2 commits into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
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.
|
On e31ff5f, connecting a physical pad suppresses the fallback reading, but the poll still calls 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. |
|
Thanks @Dathinel, confirmed and fixed in 3b0f52d. |
|
Automated triage for the maintainers. Merge candidate. Rebased cleanly. Minor: the diff also reflows a few unrelated lines in the tests and CI: passing ( Generated by Claude Code |
…OUSE_LOOK) VICTORY_MOUSE_LOOK=<sensitivity> turns mouse movement into a right-stick push on the keyboard stand-in pad while the window has focus. Off when unset or when a host pad is connected.
The mouse only drives the stand-in pad, which a connected pad turns off, but poll still called Source::mouse(), so the Windows source kept re-centring the cursor. Skip it then, and reset the centring state so the first sample after the pad goes away is discarded.
3b0f52d to
ab06200
Compare
…, every key can be rebound The title reads pads and keyboards only. The keyboard's stand-in pad had a fixed table and no mouse. The keyboard and mouse now act as a pad (modules::controls): on the first connected host pad, both at once (each stick follows whichever moved it last, a resting pad's drift never takes it), or on the stand-in pad while none is connected. - The mouse is the right stick. Raw input (no pointer acceleration) on a thread and message-only window of its own; the counts since the title's last pad read over the time since then are the stick at that read, so the same hand movement turns the same angle at any frame rate (spans up to 1 s). The title's stick dead zone is skipped (0.3 by default, measured by the source in the title), a flick past full stick is turned in full a little later. A title pad read makes a reading of its own for that. - The cursor is captured by a click in the window (hidden, held 16 px inside it), freed and captured again by Esc, freed by losing focus or by sizing or moving the window. Unlike the source, gaining focus alone does not capture: starting the title or keys.ps1 bringing it forward leave the cursor alone. The capturing click is no shot. - Mouse buttons are the triggers (left RT, right LT, middle RS); a click shorter than a frame is held for the next read (the latch of the previous commit holds buttons, not triggers). - [controls] in victory.toml rebinds every key and mouse button and the wheel, sets sensitivity, inversion, dead zone, curve, walk speed, letters by their place on a US keyboard, and a second layout a key can switch to. victory-core hands the section over as name = value entries, so victory-hle needs no TOML parser. - The default bindings are the old stand-in table exactly (Enter A, Backspace B, Esc Menu, Tab View, Q/E LB/RB, arrows D-pad, W A S D and I J K L sticks, Z/C triggers, F/H stick clicks), plus the mouse; keys go by letter, not by place, so nothing moves on a QWERTZ keyboard. The source's own layout (the series' PC keys, Q on RB, E on the D-pad) is not the default here: the measuring tools rely on the old one. - VICTORY_KEYS keys are keys like the others: the keyboard has them and the bindings make them pad input (by default as before). VICTORY_AUTO_START / VICTORY_AUTO_SKIP press A on the pad directly, whatever Enter is bound to, and Enter on the keyboard. - Diagnostics: VICTORY_KBM plays keys, mouse motion and wheel steps into the controls; gameinput=debug logs each pad state the title reads. The old fixed stand-in path is gone (the defaults are it). Tests: the controls (old table kept, rates at reads, slow frames, close reads, shaping, flicks, pad and mouse together, wheel, clicks, config and its errors) and the hub (stand-in pad, by place, riding on a host pad, the mouse at a title read, the cursor around a size loop, the [controls] entries in victory-core). Not tried in the title here. Source: ExoCalibra/victory-exo 76b65b6805 (also in grosterr and real69xaros; first written for Marvisak#1529) with its follow-ups cb3163c6ef (sizing frees the cursor) and b675e1d050 (the 0.3 dead zone), ported by hand onto our latch, receivers and automatic presses. Marvisak/VIctory PR Marvisak#2182 (cursor re-centring on the stand-in pad only) is the smaller version of the same idea and is not taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.