Input: mouse look through the stand-in pad's right stick (the title reads no GameInput mouse) #142

Open
github-bot wants to merge 1 commit from github-bot/gh-142 into main AGit
Owner

@⁠DenseCow on GitHub · 2026-11-27 18:49 UTC · original
DenseCow:mouse-look-right-stick → main · +92 −2 · 2 files · 1 commits · open

Why

The title reads only the gamepad. It ignores the GameInput mouse device, so with VICTORY_MOUSE_CAPTURE=1 (F1, MOUSE CAPTURE) the cursor is captured but the camera does not move. #103 reported the same thing.

What

  • gameinput.rs: the captured mouse's motion now drives the stand-in pad's right stick. The left button is the right trigger and the right button the left trigger. These merge with the keyboard and any real pad, in the same way the keyboard and pads already merge. The stick value is eased over polls, so a poll that falls between two mouse samples does not snap the stick back to the middle. Movement starts above a floor so that small motions get past the title's dead zone.
  • Switches, read once:
    • VICTORY_MOUSE_STICK=0 turns it off
    • VICTORY_MOUSE_SENS: stick per pixel moved in one poll (default 0.06)
    • VICTORY_MOUSE_FLOOR: least push once the mouse moves (default 0.25)
    • VICTORY_MOUSE_INVERT_Y=1: inverts up and down
  • play-foxhound.ps1: when mouse capture is on and VICTORY_MOUSE_WARP was not set, warp is turned on. Without it, the held cursor stops at the window's edge and turning stops with it. An explicit VICTORY_MOUSE_WARP=0 is still respected.

Nothing changes while mouse capture is off; capture stays off by default.

Testing

  • New unit test mouse_motion_turns_the_right_stick: reference sample, stick and trigger values, easing back to centre, no jump after focus loss, and the off switch.
  • cargo test -p victory-hle --locked: 172 passed, 0 failed.
  • Clippy (both configurations) reports nothing in gameinput.rs. The workspace-wide CI gates fail on main without this change: clippy in victory-formats and victory-gpu, and indirect::tests::host_list_budget_starts_empty_at_each_submission / warp_batch_charges_every_execution. Those are the failures #67 and #86 address.
  • Played on an RTX 5070 at the defaults in play-nvidia.ps1 with mouse capture on: the camera turns with the mouse (before this change it did not move at all).

🤖 Generated with Claude Code

**@⁠DenseCow** on GitHub · 2026-11-27 18:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142) `DenseCow:mouse-look-right-stick` → `main` · +92 −2 · 2 files · 1 commits · open ## Why The title reads only the gamepad. It ignores the GameInput mouse device, so with `VICTORY_MOUSE_CAPTURE=1` (F1, MOUSE CAPTURE) the cursor is captured but the camera does not move. #103 reported the same thing. ## What - `gameinput.rs`: the captured mouse's motion now drives the stand-in pad's **right stick**. The **left button** is the right trigger and the **right button** the left trigger. These merge with the keyboard and any real pad, in the same way the keyboard and pads already merge. The stick value is eased over polls, so a poll that falls between two mouse samples does not snap the stick back to the middle. Movement starts above a floor so that small motions get past the title's dead zone. - Switches, read once: - `VICTORY_MOUSE_STICK=0` turns it off - `VICTORY_MOUSE_SENS`: stick per pixel moved in one poll (default 0.06) - `VICTORY_MOUSE_FLOOR`: least push once the mouse moves (default 0.25) - `VICTORY_MOUSE_INVERT_Y=1`: inverts up and down - `play-foxhound.ps1`: when mouse capture is on and `VICTORY_MOUSE_WARP` was not set, warp is turned on. Without it, the held cursor stops at the window's edge and turning stops with it. An explicit `VICTORY_MOUSE_WARP=0` is still respected. Nothing changes while mouse capture is off; capture stays off by default. ## Testing - New unit test `mouse_motion_turns_the_right_stick`: reference sample, stick and trigger values, easing back to centre, no jump after focus loss, and the off switch. - `cargo test -p victory-hle --locked`: 172 passed, 0 failed. - Clippy (both configurations) reports nothing in `gameinput.rs`. The workspace-wide CI gates fail on `main` without this change: clippy in `victory-formats` and `victory-gpu`, and `indirect::tests::host_list_budget_starts_empty_at_each_submission` / `warp_batch_charges_every_execution`. Those are the failures #67 and #86 address. - Played on an RTX 5070 at the defaults in `play-nvidia.ps1` with mouse capture on: the camera turns with the mouse (before this change it did not move at all). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The title reads only the gamepad and ignores the GameInput mouse device,
so with VICTORY_MOUSE_CAPTURE=1 the cursor was held but the camera did
not move (#103).

The captured mouse's motion now drives the stand-in pad's right stick,
eased over polls and lifted past a floor so small motions get through
the title's dead zone; the left and right buttons are the right and
left triggers. VICTORY_MOUSE_STICK=0 turns it off; VICTORY_MOUSE_SENS,
VICTORY_MOUSE_FLOOR and VICTORY_MOUSE_INVERT_Y tune it.

The launcher turns VICTORY_MOUSE_WARP on with mouse capture unless it
was set: a held cursor that is not put back stops at the window's edge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 18:51:48 +00:00
Author
Owner

@⁠ardgndg on GitHub · 2026-11-27 19:30 UTC · original

how do you get mouse working?mine doesnt work at all

**@⁠ardgndg** on GitHub · 2026-11-27 19:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7226588480) how do you get mouse working?mine doesnt work at all
Author
Owner

@⁠DenseCow on GitHub · 2026-11-27 19:36 UTC · original

@⁠ardgndg On main the mouse does nothing for anyone. The game only reads the gamepad, so turning on mouse capture holds the cursor in the window but the camera never moves. This PR is the fix: it feeds the mouse into the right stick of the built-in pad. Until it is merged, you need to build this branch.

1. Get and build the branch (from your VIctory-NVIDIA folder):

git fetch origin pull/142/head:mouse-look
git checkout mouse-look
cargo build --release --locked -p victory

2. Start with mouse capture on:

.\scripts\play-nvidia.ps1 -Exe 'D:\YourDump\game_scarlett_master.exe' -More @{VICTORY_MOUSE_CAPTURE='1'}

You can also set it in the F1 menu (MOUSE CAPTURE), but that one only applies from the next start. With this branch the launcher turns on VICTORY_MOUSE_WARP for you, which keeps the camera from stopping when the cursor reaches the window's edge.

Controls: the mouse turns the camera, left button is the right trigger, right button is the left trigger. The keyboard still does everything else.

If it feels too slow or too fast, add a sensitivity to -More. The default is 0.06, and higher is faster:

-More @{VICTORY_MOUSE_CAPTURE='1'; VICTORY_MOUSE_SENS='0.1'}

VICTORY_MOUSE_INVERT_Y='1' flips up and down.

Keep in mind the game still thinks it is getting a stick, so it feels like a pad stick and not like raw mouse aim. I have only tried it on an RTX 5070, so tell me here if it does not turn for you.

**@⁠DenseCow** on GitHub · 2026-11-27 19:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7226700570) @⁠ardgndg On `main` the mouse does nothing for anyone. The game only reads the gamepad, so turning on mouse capture holds the cursor in the window but the camera never moves. This PR is the fix: it feeds the mouse into the right stick of the built-in pad. Until it is merged, you need to build this branch. **1. Get and build the branch** (from your VIctory-NVIDIA folder): ```powershell git fetch origin pull/142/head:mouse-look git checkout mouse-look cargo build --release --locked -p victory ``` **2. Start with mouse capture on:** ```powershell .\scripts\play-nvidia.ps1 -Exe 'D:\YourDump\game_scarlett_master.exe' -More @{VICTORY_MOUSE_CAPTURE='1'} ``` You can also set it in the F1 menu (MOUSE CAPTURE), but that one only applies from the next start. With this branch the launcher turns on `VICTORY_MOUSE_WARP` for you, which keeps the camera from stopping when the cursor reaches the window's edge. **Controls:** the mouse turns the camera, left button is the right trigger, right button is the left trigger. The keyboard still does everything else. **If it feels too slow or too fast**, add a sensitivity to `-More`. The default is 0.06, and higher is faster: ```powershell -More @{VICTORY_MOUSE_CAPTURE='1'; VICTORY_MOUSE_SENS='0.1'} ``` `VICTORY_MOUSE_INVERT_Y='1'` flips up and down. Keep in mind the game still thinks it is getting a stick, so it feels like a pad stick and not like raw mouse aim. I have only tried it on an RTX 5070, so tell me here if it does not turn for you.
Author
Owner

@⁠Mericas77 on GitHub · 2026-11-27 21:47 UTC · original

Tested on an RTX 4070, Windows 11: this PR (eb531ae) merged onto main at df2daaf, release build, started as victory.exe beside the title (not the script launcher). The PR's unit test passes.

With victory.exe, mouse look stops at the window's edge. With F1 > MOUSE CAPTURE > ON, the camera follows the mouse, but only for a short way: the cursor reaches the edge of the window and turning stops with it.

Adding VICTORY_MOUSE_WARP=1 fixes it. I added that line to %LOCALAPPDATA%\victory\victory-settings.txt and started again: the camera then turns without a limit.

The cause, as far as I can see: the PR switches the warp on in scripts/play-foxhound.ps1 when mouse capture is on, but the built-in launcher (apps/victory/src/play.rs) doesn't, and captured_mouse_delta in lifecycle.rs only puts the cursor back in the middle with VICTORY_MOUSE_WARP=1. Most people start the released exe, so they would get the stuck camera. The same default in play.rs (warp on when capture is on and VICTORY_MOUSE_WARP isn't set) should cover it.

The right mouse button works as the left trigger: it aims.

Not checked: the left button as the right trigger, sensitivity, and the inverted Y switch.

**@⁠Mericas77** on GitHub · 2026-11-27 21:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7228755448) Tested on an RTX 4070, Windows 11: this PR (`eb531ae`) merged onto `main` at `df2daaf`, release build, started as `victory.exe` beside the title (not the script launcher). The PR's unit test passes. **With `victory.exe`, mouse look stops at the window's edge.** With F1 > MOUSE CAPTURE > ON, the camera follows the mouse, but only for a short way: the cursor reaches the edge of the window and turning stops with it. **Adding `VICTORY_MOUSE_WARP=1` fixes it.** I added that line to `%LOCALAPPDATA%\victory\victory-settings.txt` and started again: the camera then turns without a limit. The cause, as far as I can see: the PR switches the warp on in `scripts/play-foxhound.ps1` when mouse capture is on, but the built-in launcher (`apps/victory/src/play.rs`) doesn't, and `captured_mouse_delta` in `lifecycle.rs` only puts the cursor back in the middle with `VICTORY_MOUSE_WARP=1`. Most people start the released exe, so they would get the stuck camera. The same default in `play.rs` (warp on when capture is on and `VICTORY_MOUSE_WARP` isn't set) should cover it. The right mouse button works as the left trigger: it aims. Not checked: the left button as the right trigger, sensitivity, and the inverted Y switch.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-28 01:32 UTC · original

Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #142 at head eb531ae507b2178fe69f547dd008675c8d0caa31, base 29d8dbf7d9892ceb8bec378a9dbc3c4f2931b745.
  • cargo test --locked -p victory-hle --lib -- modules::gameinput::tests::mouse_motion_turns_the_right_stick --exact --test-threads=1 --quiet → 1 passed, 0 failed, 173 filtered, exit 0.
  • git grep -F for the test name on the base returned no hits (test is new on this PR); git diff --check 29d8dbf7d HEAD clean (2 files, +92/-2: the gameinput source plus a 2-line env-var default in scripts/play-foxhound.ps1 — no game data).
  • Used a per-worktree CARGO_TARGET_DIR (target-142-watch) with CARGO_BUILD_JOBS=2.
  • Only the named synthetic test was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain).
  • GPU/driver: N/A (CPU-only HLE test). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-28 01:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7231734295) Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #142 at head `eb531ae507b2178fe69f547dd008675c8d0caa31`, base `29d8dbf7d9892ceb8bec378a9dbc3c4f2931b745`. - `cargo test --locked -p victory-hle --lib -- modules::gameinput::tests::mouse_motion_turns_the_right_stick --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 173 filtered, exit 0. - `git grep -F` for the test name on the base returned no hits (test is new on this PR); `git diff --check 29d8dbf7d HEAD` clean (2 files, +92/-2: the gameinput source plus a 2-line env-var default in scripts/play-foxhound.ps1 — no game data). - Used a per-worktree `CARGO_TARGET_DIR` (target-142-watch) with `CARGO_BUILD_JOBS=2`. - Only the named synthetic test was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain). - GPU/driver: N/A (CPU-only HLE test). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/142/head:github-bot/gh-142'
git switch 'github-bot/gh-142'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-142'
git switch 'github-bot/gh-142'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-142'
git switch 'github-bot/gh-142'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-142'
git switch 'main'
git merge --squash 'github-bot/gh-142'
git switch 'main'
git merge --ff-only 'github-bot/gh-142'
git switch 'main'
git merge 'github-bot/gh-142'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.