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
github-bot wants to merge 1 commit from github-bot/gh-153 into main AGit
Owner

@⁠mavis140 on GitHub · 2026-11-26 08:10 UTC · original
mavis140:mouse-look → main · +374 −17 · 3 files · 1 commits · closed without merging

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

**@⁠mavis140** on GitHub · 2026-11-26 08:10 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/153) `mavis140:mouse-look` → `main` · +374 −17 · 3 files · 1 commits · closed without merging 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)
With no pad connected the keyboard is the title's pad, and the camera was
on I/J/K/L. With VICTORY_MOUSE=1 the mouse is part of that pad: its travel
is the right stick, its left and right buttons the right and left trigger,
and the keys are laid out the way third-person titles are on a PC (Shift A,
Space X, F Y, R B, Tab and Q the shoulders, Ctrl and C the stick clicks).
Unset, nothing changes: the old key table and its test are as they were.

A stick sets how fast the camera turns and a mouse how far. `Look` keeps the
travel and pays it out as a deflection over 45 ms, so the whole of a
movement arrives and the stick comes to rest; a deflection starts above the
share a title ignores around the middle (VICTORY_MOUSE_SPEED,
VICTORY_MOUSE_DEAD).

A pad has one set of buttons for walking and driving and a title does not
say which it is at, so Caps Lock switches the keys to driving and back: W
and S are the triggers, Space the right shoulder.

The pointer is kept inside the title's window while it has focus and not
shown over the picture (WM_SETCURSOR in lifecycle's window procedure); F8
lets it go and takes it again.

Tests: the two layouts side by side, the driving layout, and that mouse
travel arrives whole (300 pixels in, 300 paid out, stick at rest).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:15:09 +00:00
github-bot closed this pull request 2026-11-26 19:58:42 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.