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

Merged
DenseCow merged 1 commit from upstream-pr/142 into main 2026-11-29 08:17:00 +00:00
DenseCow commented 2026-11-27 18:49:51 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DenseCow on 2026-11-27T18:49:51Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5531620689 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142). Originally posted by [DenseCow](https://github.com/DenseCow) on 2026-11-27T18:49:51Z. --- ## 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)
ardgndg commented 2026-11-27 19:30:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ardgndg on 2026-11-27T19:30:04Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7226588480 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7226588480). Originally posted by [ardgndg](https://github.com/ardgndg) on 2026-11-27T19:30:04Z. --- how do you get mouse working?mine doesnt work at all
DenseCow commented 2026-11-27 19:36:51 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DenseCow on 2026-11-27T19:36:51Z.


@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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7226700570 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7226700570). Originally posted by [DenseCow](https://github.com/DenseCow) on 2026-11-27T19:36:51Z. --- @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.
Mericas77 commented 2026-11-27 21:47:22 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Mericas77 on 2026-11-27T21:47:22Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7228755448 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7228755448). Originally posted by [Mericas77](https://github.com/Mericas77) on 2026-11-27T21:47:22Z. --- 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.
cloph-dsp commented 2026-11-28 01:32:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-28T01:32:07Z.


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231734295 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/142#issuecomment-7231734295). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T01:32:07Z. --- 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).
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
trustno1-coder/VIctory-NVIDIA!142
No description provided.