Input: native mouse aiming and vehicle controls from #1356 #1570

Open
github-bot wants to merge 3 commits from github-bot/gh-1570 into main AGit
Owner

@⁠MaroonCoffee on GitHub · 2026-11-28 21:50 UTC · original
MaroonCoffee:codex/mouse-input-pr-1356 → main · +2839 −48 · 12 files · 1 commits · open

Related: #1356 — mouse/input-only extraction.

What it changes

This adapts the mouse and input work originally implemented by
@⁠lyufeng000 (李雨峰) in #1356.
Credit for the original implementation belongs to them; this PR separates
those changes from the larger proposal and integrates them with main's
existing input code.

Their changes included here:

  • Native mouse camera aiming using raw mouse deltas, with ADS/zoom scaling.
  • Cursor release and recapture for menus, the map, the F1 overlay, and focus
    changes, including swallowing the recapture click to prevent firing.
  • Mouse selection of radial-wheel sectors and wheel scrolling through items.
  • Vehicle-specific keyboard and mouse controls, seat detection, and a
    toggle for vehicle camera auto-centering.
  • Live sensitivity and capture controls through F8, F9, [ and ].
  • The required loader hooks and input documentation.

Integration resolves conflicts with the existing mouse-and-keyboard mode,
key-binding menu, and window handling. The legacy mouse sampler remains
available with VICTORY_NATIVE_MOUSE=0, avoiding competing cursor handling
while native aiming is enabled.

The DLSS warm-up, portable launcher, hardware notes, and asset-policy
changes from #1356 are excluded. Existing warm-up and launcher behavior
is preserved.

The commit includes a Co-authored-by credit for 李雨峰.

How it was tested

  • GPU and profile: NVIDIA GeForce RTX 4080 SUPER; Series S, 720 setting,
    DLSS Quality, 2× DLSS frame generation, ray tracing disabled.
  • Before: Existing mouse-to-stick/custom-binding input path. No quantitative
    aiming or performance baseline was collected.
  • After: A subsequent native-mouse-enabled launch passed the loading/intro
    point. An initial loading hang was observed; disabling native mouse also
    passed that point, and the hang did not reproduce on the later enabled
    run. Its cause is unconfirmed. Full manual coverage of all controls is
    still needed.
  • For shader changes, wave sizes tested: N/A; no shader changes.
  • cargo test passed for the crates it touches: yes — victory,
    victory-hle, victory-loader, and victory-gpu passed during
    cargo test --workspace --locked --offline.
  • The full workspace run did not pass: unchanged victory-shader tests
    failed DXIL validation, and its test process exited with an access
    violation. The repository-wide policy test separately flagged the
    existing oversized crates/victory-shader/src/emit/lower.rs.
  • The staged asset-policy check passed for all 12 changed files.

Checked for overlap

  • I searched the open pull requests for mouse/input/cursor work and
    checked overlapping files. Related:
    • #1356: original implementation and direct source of these changes.
    • #967: existing optional mouse-and-keyboard profile.
    • #652: alternative mouse-look and configurable-input work.
    • #591 and #1002: overlapping cursor capture and window handling.

This PR is a partial adaptation of #1356, not a replacement for its
remaining warm-up and launcher proposals.

AI-assisted, changes and PR written with Codex

**@⁠MaroonCoffee** on GitHub · 2026-11-28 21:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1570) `MaroonCoffee:codex/mouse-input-pr-1356` → `main` · +2839 −48 · 12 files · 1 commits · open Related: #1356 — mouse/input-only extraction. ## What it changes This adapts the mouse and input work originally implemented by @⁠lyufeng000 (李雨峰) in https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/1356. Credit for the original implementation belongs to them; this PR separates those changes from the larger proposal and integrates them with main's existing input code. Their changes included here: - Native mouse camera aiming using raw mouse deltas, with ADS/zoom scaling. - Cursor release and recapture for menus, the map, the F1 overlay, and focus changes, including swallowing the recapture click to prevent firing. - Mouse selection of radial-wheel sectors and wheel scrolling through items. - Vehicle-specific keyboard and mouse controls, seat detection, and a toggle for vehicle camera auto-centering. - Live sensitivity and capture controls through F8, F9, `[` and `]`. - The required loader hooks and input documentation. Integration resolves conflicts with the existing mouse-and-keyboard mode, key-binding menu, and window handling. The legacy mouse sampler remains available with `VICTORY_NATIVE_MOUSE=0`, avoiding competing cursor handling while native aiming is enabled. The DLSS warm-up, portable launcher, hardware notes, and asset-policy changes from #1356 are excluded. Existing warm-up and launcher behavior is preserved. The commit includes a Co-authored-by credit for 李雨峰. ## How it was tested - GPU and profile: NVIDIA GeForce RTX 4080 SUPER; Series S, 720 setting, DLSS Quality, 2× DLSS frame generation, ray tracing disabled. - Before: Existing mouse-to-stick/custom-binding input path. No quantitative aiming or performance baseline was collected. - After: A subsequent native-mouse-enabled launch passed the loading/intro point. An initial loading hang was observed; disabling native mouse also passed that point, and the hang did not reproduce on the later enabled run. Its cause is unconfirmed. Full manual coverage of all controls is still needed. - For shader changes, wave sizes tested: N/A; no shader changes. - `cargo test` passed for the crates it touches: yes — `victory`, `victory-hle`, `victory-loader`, and `victory-gpu` passed during `cargo test --workspace --locked --offline`. - The full workspace run did not pass: unchanged `victory-shader` tests failed DXIL validation, and its test process exited with an access violation. The repository-wide policy test separately flagged the existing oversized `crates/victory-shader/src/emit/lower.rs`. - The staged asset-policy check passed for all 12 changed files. ## Checked for overlap - [x] I searched the open pull requests for mouse/input/cursor work and checked overlapping files. Related: - #1356: original implementation and direct source of these changes. - #967: existing optional mouse-and-keyboard profile. - #652: alternative mouse-look and configurable-input work. - #591 and #1002: overlapping cursor capture and window handling. This PR is a partial adaptation of #1356, not a replacement for its remaining warm-up and launcher proposals. AI-assisted, changes and PR written with Codex
Adapt the mouse/input portion of trustno1-coder/VIctory-NVIDIA#1356.
Include raw mouse camera aiming, radial-wheel selection and scrolling,
vehicle input mapping, cursor capture/release, and the required hooks.
Resolve integration with the existing mouse-and-keyboard mode.

Keep the original DLSS warm-up and launcher behavior. Exclude the
pre-launch DLSS warm-up, portable launcher, and unrelated policy changes.

Co-authored-by: 李雨峰 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:54:12 +00:00
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-29 05:38 UTC · original

Live-tested on 9800X3D + RTX 5070 Ti 16 GB (Windows 11, 21m+ session). Huge upgrade over right-stick mouse emulation: raw-delta aiming feels 1:1 with zero floatiness, Map/Pause/F1 cursor auto-release works reliably, and vehicle driver-seat controls detected and switched cleanly.

**@⁠amazedturnip** on GitHub · 2026-11-29 05:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1570#issuecomment-7251374469) Live-tested on 9800X3D + RTX 5070 Ti 16 GB (Windows 11, 21m+ session). Huge upgrade over right-stick mouse emulation: raw-delta aiming feels 1:1 with zero floatiness, Map/Pause/F1 cursor auto-release works reliably, and vehicle driver-seat controls detected and switched cleanly.
Author
Owner

@⁠JoeY54 on GitHub · 2026-11-29 06:18 UTC · original

Hands-on report on this PR's input path (head 74235e3), RTX 5090.

I used this PR's camera, menu/pause, radial-wheel and seat logic with unchanged behaviour, but read every address, offset and layout from a local data file loaded at start instead of constants in the source. With that file the build has native aiming; without it the same build says native aiming is unavailable and falls back to stick emulation. Your three unit tests (HUD visibility, seats, camera hold) pass against that version when it is given the numbers from this PR.

Results (manual play, no measurements):

1:1 small corrections and fast turns, no stick speed ceiling
aiming down sights lowers the sensitivity
the cursor is released on pause and map; the click that re-locks it does not fire
weapon wheel by mouse, scroll cycles items
Alt+Tab in and out is fine
the driver seat is detected and switches to vehicle keys (W/S throttle and brake, handbrake, horn, lights); RMB aims while driving
one gap: the map did not zoom with the mouse wheel (the cursor is released there and the wheel was only forwarded while captured). A short LT/RT press per wheel notch while a menu is up fixed it.

Not tested: aircraft and boats, long sessions, latency or aim measurements.

Would a split like this be useful upstream, or do you prefer keeping the offsets in-tree as docs/asset-policy.md allows? Happy to share the generic part either way.

Generated by Claude Code

**@⁠JoeY54** on GitHub · 2026-11-29 06:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1570#issuecomment-7251774967) Hands-on report on this PR's input path (head 74235e3), RTX 5090. I used this PR's camera, menu/pause, radial-wheel and seat logic with unchanged behaviour, but read every address, offset and layout from a local data file loaded at start instead of constants in the source. With that file the build has native aiming; without it the same build says native aiming is unavailable and falls back to stick emulation. Your three unit tests (HUD visibility, seats, camera hold) pass against that version when it is given the numbers from this PR. Results (manual play, no measurements): 1:1 small corrections and fast turns, no stick speed ceiling aiming down sights lowers the sensitivity the cursor is released on pause and map; the click that re-locks it does not fire weapon wheel by mouse, scroll cycles items Alt+Tab in and out is fine the driver seat is detected and switches to vehicle keys (W/S throttle and brake, handbrake, horn, lights); RMB aims while driving one gap: the map did not zoom with the mouse wheel (the cursor is released there and the wheel was only forwarded while captured). A short LT/RT press per wheel notch while a menu is up fixed it. Not tested: aircraft and boats, long sessions, latency or aim measurements. Would a split like this be useful upstream, or do you prefer keeping the offsets in-tree as docs/asset-policy.md allows? Happy to share the generic part either way. Generated by [Claude Code](https://claude.ai/code)
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-29 08:28 UTC · original

Thank you! An earlier version of this pull request was merged into main with its original commits and is part of v2026.11.29.01, where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.

**@⁠trustno1-coder** on GitHub · 2026-11-29 08:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1570#issuecomment-7253125351) Thank you! An earlier version of this pull request was merged into main with its original commits and is part of [v2026.11.29.01](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.01), where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.
Author
Owner

@⁠lyufeng000 on GitHub · 2026-11-29 10:43 UTC · original

@⁠JoeY54 Thanks for the thorough testing and feedback! I opened a clean follow-up PR #2225 on top of current main that closes the map wheel zoom gap (using native cursor-pivot MapCam::ZoomStepWithPivot with LT/RT fallback), adds 1:1 map dragging, native fwui menu hover hit-testing, and F1 overlay mouse/wheel controls.

Regarding the offset layout question: keeping the per-build offsets and prologue checks in-tree (per docs/asset-policy.md) is intentional so native aiming stays out-of-the-box without requiring users to manage an external data file, while still failing closed and falling back cleanly when a prologue doesn't match.

**@⁠lyufeng000** on GitHub · 2026-11-29 10:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1570#issuecomment-7254626675) @⁠JoeY54 Thanks for the thorough testing and feedback! I opened a clean follow-up PR #2225 on top of current `main` that closes the map wheel zoom gap (using native cursor-pivot `MapCam::ZoomStepWithPivot` with `LT`/`RT` fallback), adds 1:1 map dragging, native `fwui` menu hover hit-testing, and F1 overlay mouse/wheel controls. Regarding the offset layout question: keeping the per-build offsets and prologue checks in-tree (per `docs/asset-policy.md`) is intentional so native aiming stays out-of-the-box without requiring users to manage an external data file, while still failing closed and falling back cleanly when a prologue doesn't match.
This pull request has changes conflicting with the target branch.
  • README.md
  • apps/victory/src/play.rs
  • crates/victory-gpu/src/host/menu.rs
  • crates/victory-hle/src/modules/gameinput.rs
  • crates/victory-hle/src/modules/lifecycle.rs
  • crates/victory-hle/src/mousehook.rs
  • docs/architecture.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1570'
git switch 'github-bot/gh-1570'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1570'
git switch 'github-bot/gh-1570'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1570'
git switch 'main'
git merge --squash 'github-bot/gh-1570'
git switch 'main'
git merge --ff-only 'github-bot/gh-1570'
git switch 'main'
git merge 'github-bot/gh-1570'
git push origin 'main'
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!1570
No description provided.