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

Closed
mavis140 wants to merge 1 commit from upstream-pr/153 into main
mavis140 commented 2026-11-26 08:10:26 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by mavis140 on 2026-11-26T08:10:26Z.


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: 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.rs
    • Look: mouse travel paid out as a stick deflection over 45 ms, so a whole movement arrives and the
      stick 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 / 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):
      a pad has one set of buttons for both and a title does not say which it is at.
    • 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.
  • 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/README-fxceless.md: the key table for the mode and its three variables.

Tested

  • AMD Radeon RX 9070 XT 16 GB (RDNA 4, driver 32.0.32029.2010), Ryzen 7 9800X3D, 32 GB DDR5,
    Windows 11 build 26200, title on an NVMe SSD; Rust 1.98.1 (the pinned toolchain), diag profile
    with --features diagnostics, on main at 39031cb.
  • cargo test -p victory-hle --locked: 154 passed, 0 failed, 2 ignored (lib), plus 1 + 1 passed in
    the 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 this
    far on main today: victory-gpu has 31 findings and dstorage.rs 4, none from this change.)
  • In the title, played by hand for 18 minutes on the machine above, with this code before it was put behind
    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

  • In the title: the Caps Lock driving layout and F8 (neither was pressed in that session; both are covered
    by unit tests only), and the final build with VICTORY_MOUSE=1 set (the session above ran the same code
    with the mode always on).
  • NVIDIA and Intel GPUs (the change is input only), Wine / Proton (the pointer calls are plain
    user32, but untried there), a real pad connected at the same time as the mouse.
  • The keys are mapped to pad buttons by GTA V's pad layout; a title that assigns a button differently
    will want a different key for it.

AI use

  • Written with Claude Code (Claude Fable 5.2): the code, the tests, the docs entry and this description.
    The in-title check was done by hand by the submitter.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5506339745 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/153). Originally posted by [mavis140](https://github.com/mavis140) on 2026-11-26T08:10:26Z. --- 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: 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.rs` - `Look`: mouse travel paid out as a stick deflection over 45 ms, so a whole movement arrives and the stick 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 / 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): a pad has one set of buttons for both and a title does not say which it is at. - 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. - `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/README-fxceless.md`: the key table for the mode and its three variables. **Tested** - AMD Radeon RX 9070 XT 16 GB (RDNA 4, driver 32.0.32029.2010), Ryzen 7 9800X3D, 32 GB DDR5, Windows 11 build 26200, title on an NVMe SSD; Rust 1.98.1 (the pinned toolchain), `diag` profile with `--features diagnostics`, on `main` at 39031cb. - `cargo test -p victory-hle --locked`: 154 passed, 0 failed, 2 ignored (lib), plus 1 + 1 passed in the 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 this far on `main` today: `victory-gpu` has 31 findings and `dstorage.rs` 4, none from this change.) - In the title, played by hand for 18 minutes on the machine above, with this code before it was put behind 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** - In the title: the Caps Lock driving layout and F8 (neither was pressed in that session; both are covered by unit tests only), and the final build with `VICTORY_MOUSE=1` set (the session above ran the same code with the mode always on). - NVIDIA and Intel GPUs (the change is input only), Wine / Proton (the pointer calls are plain user32, but untried there), a real pad connected at the same time as the mouse. - The keys are mapped to pad buttons by GTA V's pad layout; a title that assigns a button differently will want a different key for it. **AI use** - Written with Claude Code (Claude Fable 5.2): the code, the tests, the docs entry and this description. The in-title check was done by hand by the submitter. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

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
avatarmanz/VIctory-7900XTX!153
No description provided.