F1 menu: MOUSE LOOK SENSITIVITY, applied without a restart #1149

Closed
github-bot wants to merge 3 commits from github-bot/gh-1149 into main AGit
Owner

@⁠Alxspb on GitHub · 2026-11-28 14:17 UTC · original
Alxspb:feat/f1-mouse-sens → main · +558 −18 · 5 files · 3 commits · closed without merging

What

One new row in the F1 settings menu — MOUSE LOOK SENSITIVITY — that changes the keyboard-and-mouse look's multiplier at once, without restarting the game.

Stacked on #989. GitHub cannot take another fork's branch as the base, so this PR is against main and its diff carries #989's two commits as well. Only the last commit (de4b21b) is new here; after #989 lands, this becomes a one-commit diff.

Why it matters

VICTORY_MOUSE_SENS (from #989) is read once into a LazyLock, at the first poll (gameinput.rs:1487). Matching that number to the title's own look slider therefore means: close the game, edit the environment, start again, sit through the one-time shader recompile — minutes per attempt, at something a player judges in seconds while moving the mouse.

The multiplier scales deflection per pixel in stick space: BASE_SENS (0.022) times sens, written into the stand-in pad's right stick (gameinput.rs, MouseLook::BASE_SENS / MouseLook::step). That is the right thing to expose, and the GDKX side of it is explicit: XInputOnGameInput's XINPUT_GAMEPAD says each thumbstick axis is "a signed value that is between -32768 and 32767 and describes the position of the thumbstick", and that "the constants XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE and XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE can be used as positive and negative values for filtering a thumbstick input" (GDKX docs, reference/input/xinputongameinput/structs/xinput_gamepad.md, the sThumbLX paragraph). So the title filters the stick through its own dead zone and applies its own sensitivity on top: warping the mouse instead of scaling the deflection would fight both, while a multiplier of the deflection composes with them — and the multiplier is what a player wants to reach for.

How

  • the value moves into one atomic in victory-gpu (KBM_MOUSE_SENS, plus kbm_mouse_sens() / set_kbm_mouse_sens()), placed next to SETTINGS_MENU_OPEN — the atomic the input module already reads from this crate for the same reason, so no new cross-crate coupling is added;
  • gameinput.rs keeps its meaning and simply reads the getter; unset is still 1, and a VICTORY_MOUSE_SENS set before the start still wins (the first read of the getter takes it);
  • the menu row is live: true and rides the same path as the other live rows (FPS AT THE TOP, STATS PANEL) in Menu::apply_live: the environment is updated too, so the row is written into the settings file and old configs keep working.

Relation to other work

  • #989 — the mouse on the stand-in pad's right stick, and the variable this row edits.
  • #1002 — capture and warp paused while the window is dragged: the same capture state, untouched here.
  • #982 — the launcher picks the keyboard pad's keys (VICTORY_KEYMAP); the look's strength is the other half of "make the pad feel like a mouse", and it belongs in the menu rather than in another variable set before the start.

Test

cargo check -p victory-gpu --target x86_64-pc-windows-msvc clean. A release build with this row on top of a play-test stack of 12 performance PRs is green in CI: https://github.com/Alxspb/VIctory-NVIDIA/actions/runs/46150609666 (exe 11 606 528 bytes, sha256 da50a61e5c0b9fd72829718f5555d189683038cc75db0afcc1a3b7169d4d08da). Play-test on an RTX 5060 Ti 16 GB / i5-13600KF (Series S job, DLSS Quality, 2x frame generation) is with the tester now; I will report back here either way.

**@⁠Alxspb** on GitHub · 2026-11-28 14:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1149) `Alxspb:feat/f1-mouse-sens` → `main` · +558 −18 · 5 files · 3 commits · closed without merging ## What One new row in the F1 settings menu — `MOUSE LOOK SENSITIVITY` — that changes the keyboard-and-mouse look's multiplier **at once**, without restarting the game. > **Stacked on #989.** GitHub cannot take another fork's branch as the base, so this PR is against `main` and its diff carries #989's two commits as well. Only the **last commit** (`de4b21b`) is new here; after #989 lands, this becomes a one-commit diff. ## Why it matters `VICTORY_MOUSE_SENS` (from #989) is read once into a `LazyLock`, at the first poll ([gameinput.rs:1487](https://github.com/trustno1-coder/VIctory-NVIDIA/blob/main/crates/victory-hle/src/modules/gameinput.rs)). Matching that number to the title's own look slider therefore means: close the game, edit the environment, start again, sit through the one-time shader recompile — minutes per attempt, at something a player judges in seconds while moving the mouse. The multiplier scales deflection per pixel in **stick space**: `BASE_SENS` (0.022) times `sens`, written into the stand-in pad's right stick (`gameinput.rs`, `MouseLook::BASE_SENS` / `MouseLook::step`). That is the right thing to expose, and the GDKX side of it is explicit: `XInputOnGameInput`'s `XINPUT_GAMEPAD` says each thumbstick axis is "a signed value that is between -32768 and 32767 and describes the position of the thumbstick", and that "the constants XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE and XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE can be used as positive and negative values for filtering a thumbstick input" (GDKX docs, `reference/input/xinputongameinput/structs/xinput_gamepad.md`, the `sThumbLX` paragraph). So the title filters the stick through its own dead zone and applies its own sensitivity on top: warping the mouse instead of scaling the deflection would fight both, while a multiplier of the deflection composes with them — and the multiplier is what a player wants to reach for. ## How - the value moves into one atomic in `victory-gpu` (`KBM_MOUSE_SENS`, plus `kbm_mouse_sens()` / `set_kbm_mouse_sens()`), placed next to `SETTINGS_MENU_OPEN` — the atomic the input module already reads from this crate for the same reason, so no new cross-crate coupling is added; - `gameinput.rs` keeps its meaning and simply reads the getter; unset is still 1, and a `VICTORY_MOUSE_SENS` set before the start still wins (the first read of the getter takes it); - the menu row is `live: true` and rides the same path as the other live rows (`FPS AT THE TOP`, `STATS PANEL`) in `Menu::apply_live`: the environment is updated too, so the row is written into the settings file and old configs keep working. ## Relation to other work - #989 — the mouse on the stand-in pad's right stick, and the variable this row edits. - #1002 — capture and warp paused while the window is dragged: the same capture state, untouched here. - #982 — the launcher picks the keyboard pad's keys (`VICTORY_KEYMAP`); the look's strength is the other half of "make the pad feel like a mouse", and it belongs in the menu rather than in another variable set before the start. ## Test `cargo check -p victory-gpu --target x86_64-pc-windows-msvc` clean. A release build with this row on top of a play-test stack of 12 performance PRs is green in CI: https://github.com/Alxspb/VIctory-NVIDIA/actions/runs/46150609666 (exe 11 606 528 bytes, `sha256 da50a61e5c0b9fd72829718f5555d189683038cc75db0afcc1a3b7169d4d08da`). Play-test on an RTX 5060 Ti 16 GB / i5-13600KF (Series S job, DLSS Quality, 2x frame generation) is with the tester now; I will report back here either way.
On some PCs the title registers device callbacks for keyboards (0x10) and
gamepads (0x40000) only, never mice (0x20), so the mouse device never reaches
it and the camera does not follow the mouse. With VICTORY_KBM_GTA=1 the mouse
reaches it as the stand-in pad instead: captured motion (lifecycle's
VICTORY_MOUSE_CAPTURE path, warping by default) turns the right stick, with
a 45 ms half-life back to centre; LMB = RT, RMB = LT, MMB = R3. Keys follow
GTA V's PC layout (GTA_BUTTONS), by place as the default table; I/J/K/L
still turn the camera. Only while the window is in front, the F1 menu is
closed and the stand-in is the title's pad. Off by default; F1 row added.

Ported from VIctory's c485827 (PR #295), on this fork's capture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With VICTORY_KBM_GTA=1 the cursor was clipped and warped whenever the game was
in front, so the window could not be moved nor its title bar reached. The
capture now holds the mouse only while locked: locked from the start (the log
says F2 releases the mouse), F2 or ` / ~ toggles it, losing the front unlocks
it, and only F2 or a left click in the client area locks it again (title bar
and border clicks are non-client messages and never lock). Unlocked: no clip,
no warp, the cursor shown, no motion on the right stick.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The keyboard-and-mouse look read its multiplier once at the start
(gameinput.rs), so matching the feel meant restarting the game. The
value now lives in one atomic the input module reads at each poll and
the settings menu writes; the menu row changes it at once.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:34:28 +00:00
github-bot closed this pull request 2026-11-30 16:33:42 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1149
No description provided.