Input: the mouse as the stand-in pad's right stick and triggers, with a PC key layout (VICTORY_MOUSE=1, off by default) #1274

Closed
Livertea wants to merge 1 commit from upstream-pr/1277 into main
Livertea commented 2026-11-26 09:17:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Livertea on 2026-11-26T09:17:28Z.


Ports avatarmanz/VIctory-7900XTX#153 (mavis140) — mouse-look — to victory-fork.

With 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=1 the 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.

What changed vs the original PR (adapted for victory-fork, which predates the one_pad refactor)

  • crates/victory-hle/src/modules/gameinput.rs
    • Look: mouse travel paid out as a stick deflection over 45 ms, so a whole movement arrives and the stick comes to rest (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 / C stick clicks, V View, Esc / P Menu), used only with the switch on.
    • Caps Lock switches the keys to driving and back (W and S the triggers, Space the right shoulder).
    • The host side: the pointer is read, re-centred and kept inside the title's window while it has focus; F8 lets it go and takes it again; losing focus lets it go.
    • No one_pad here: victory-fork has no one_pad machinery, so the mouse feeds the existing fallback() path (used when no pad is connected) instead of the merged pad. The a_host_pad_feeds_the_one_pad_which_never_goes test is dropped — it needs fake_with(bool), which doesn't exist here.
  • crates/victory-hle/src/modules/lifecycle.rs: no pointer over the picture while the mouse is held (WM_SETCURSOR in the window procedure that is already hooked).
  • Docs entry dropped: docs/README-fxceless.md was deleted in victory-fork's HEAD, so there's no docs file to add the key table to.

Tested

  • cargo test -p victory-hle --locked on victory-fork main at f6a09d3: 105 passed, 1 failed. All 3 mouse tests pass (right stick/triggers, driving pedals, travel payout), and all 10 gameinput tests pass. The one failure is modules::display::tests::sdr_and_display_deferrals — a display test in a file this PR doesn't touch (HRESULT 0x800700AA, resource in use); pre-existing/environmental, not from this change.
  • Not hand-played on victory-fork yet — the same code was played by hand on AvatarManz (18 minutes, RX 9070 XT, by the original author; and on this machine's AvatarManz build, RX 7900 XT, mouse confirmed working in-game), but the victory-fork build itself has only the unit tests so far.

AI use
Written with Jimbob (Meta Muse): the port, the tests, and this description.

🤖 Generated with Jimbob

<!-- greyfinch-sync:fxceless/victory-fork:issue:6623406890 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1277). Originally posted by [Livertea](https://github.com/Livertea) on 2026-11-26T09:17:28Z. --- Ports avatarmanz/VIctory-7900XTX#153 (mavis140) — mouse-look — to victory-fork. With 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=1` the 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. **What changed vs the original PR** (adapted for victory-fork, which predates the `one_pad` refactor) - `crates/victory-hle/src/modules/gameinput.rs` - `Look`: mouse travel paid out as a stick deflection over 45 ms, so a whole movement arrives and the stick comes to rest (`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 / C stick clicks, V View, Esc / P Menu), used only with the switch on. - Caps Lock switches the keys to driving and back (W and S the triggers, Space the right shoulder). - The host side: the pointer is read, re-centred and kept inside the title's window while it has focus; F8 lets it go and takes it again; losing focus lets it go. - No `one_pad` here: victory-fork has no `one_pad` machinery, so the mouse feeds the existing `fallback()` path (used when no pad is connected) instead of the merged pad. The `a_host_pad_feeds_the_one_pad_which_never_goes` test is dropped — it needs `fake_with(bool)`, which doesn't exist here. - `crates/victory-hle/src/modules/lifecycle.rs`: no pointer over the picture while the mouse is held (`WM_SETCURSOR` in the window procedure that is already hooked). - Docs entry dropped: `docs/README-fxceless.md` was deleted in victory-fork's HEAD, so there's no docs file to add the key table to. **Tested** - `cargo test -p victory-hle --locked` on victory-fork main at f6a09d3: 105 passed, 1 failed. All 3 mouse tests pass (right stick/triggers, driving pedals, travel payout), and all 10 gameinput tests pass. The one failure is `modules::display::tests::sdr_and_display_deferrals` — a display test in a file this PR doesn't touch (HRESULT 0x800700AA, resource in use); pre-existing/environmental, not from this change. - Not hand-played on victory-fork yet — the same code was played by hand on AvatarManz (18 minutes, RX 9070 XT, by the original author; and on this machine's AvatarManz build, RX 7900 XT, mouse confirmed working in-game), but the victory-fork build itself has only the unit tests so far. AI use Written with Jimbob (Meta Muse): the port, the tests, and this description. 🤖 Generated with Jimbob
upstream-sync closed this pull request 2026-11-26 14:03:24 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1274
No description provided.