Keyboard and mouse: PC layout, mouse look, remapping page (F2) #482

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

@⁠Dyslex1337 on GitHub · 2026-11-27 23:17 UTC · original
Dyslex1337:fix/mouse-look-stand-in-pad → main · +1289 −69 · 8 files · 3 commits · open

Summary

The mouse did nothing in game. The title registers GameInput callbacks for pads and keyboards only, never for the mouse, so the emulated mouse was never read. This PR feeds keyboard and mouse to the title through the stand-in pad, with the PC layout of the series and a page to rebind everything.

Keyboard and mouse page, on foot

Mouse and options

Changes

  • PC layout by default: WASD, F enter/leave vehicle, Space jump/handbrake, Shift sprint, Ctrl crouch, Q cover, mouse to aim and shoot, W/S to drive, Tab weapon wheel. The full table is in the README.
  • Mouse look: mouse motion drives the right stick. Movement past full deflection carries over to the next polls, so fast flicks turn the whole way. Sensitivity runs from 0.01 to 2.00, and Y can be inverted.
  • On foot and vehicle profiles, because the pad's controls differ (RT shoots on foot and accelerates in a vehicle). The profile switches three ways:
    • F switches it, with a 2 s guard so a second press doesn't switch back.
    • Caps Lock switches it by hand.
    • A freshly pressed key that only works in the other profile (for example Shift after leaving a car) switches to that profile.
    • The FPS line shows the active profile.
  • Keyboard and mouse page (F2, or F1 > KEYBOARD AND MOUSE):
    • Tabs for on foot, vehicle, and mouse/options.
    • Every action has two key slots, and mouse buttons can be bound.
    • When a key is already bound to another action, the page names that action.
    • Changes apply and save immediately, and each tab can be reset.
  • Frame rate cap in the F1 menu now applies live.

Files

  • victory-gpu/src/keymap.rs (new): bindings, defaults, profiles, settings (VICTORY_BIND_*, VICTORY_MOUSE_LOOK, VICTORY_MOUSE_INVERT).
  • victory-gpu/src/host/menu/keypage.rs (new): the page. menu.rs adds F2, inverted highlight cells, and key capture.
  • victory-hle/src/modules/gameinput.rs: the stand-in pad is built from the key map, plus mouse look.
  • victory-hle/src/modules/lifecycle.rs: the captured pointer is warped back by default (VICTORY_MOUSE_WARP=0 turns this off).
  • victory-gpu/src/frame.rs: live frame rate cap.

Testing

  • Played on an RTX 4070 / Windows 10: walking, aiming and shooting, entering and leaving cars, driving, rebinding keys.
  • cargo test -p victory-hle: all pass. In victory-gpu, the new keymap, keypage, menu and frame tests pass. On this Windows 10 machine, a few existing tests that create a D3D12 device crash the test process, in files this PR doesn't touch.
**@⁠Dyslex1337** on GitHub · 2026-11-27 23:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482) `Dyslex1337:fix/mouse-look-stand-in-pad` → `main` · +1289 −69 · 8 files · 3 commits · open ## Summary The mouse did nothing in game. The title registers GameInput callbacks for pads and keyboards only, never for the mouse, so the emulated mouse was never read. This PR feeds keyboard and mouse to the title through the stand-in pad, with the PC layout of the series and a page to rebind everything. ![Keyboard and mouse page, on foot](https://raw.githubusercontent.com/Dyslex1337/VIctory-NVIDIA/pr-screenshots/keys-on-foot.png) ![Mouse and options](https://raw.githubusercontent.com/Dyslex1337/VIctory-NVIDIA/pr-screenshots/mouse-and-options.png) ## Changes - **PC layout by default:** WASD, F enter/leave vehicle, Space jump/handbrake, Shift sprint, Ctrl crouch, Q cover, mouse to aim and shoot, W/S to drive, Tab weapon wheel. The full table is in the README. - **Mouse look:** mouse motion drives the right stick. Movement past full deflection carries over to the next polls, so fast flicks turn the whole way. Sensitivity runs from 0.01 to 2.00, and Y can be inverted. - **On foot and vehicle profiles**, because the pad's controls differ (RT shoots on foot and accelerates in a vehicle). The profile switches three ways: - F switches it, with a 2 s guard so a second press doesn't switch back. - Caps Lock switches it by hand. - A freshly pressed key that only works in the other profile (for example Shift after leaving a car) switches to that profile. - The FPS line shows the active profile. - **Keyboard and mouse page (F2, or F1 > KEYBOARD AND MOUSE):** - Tabs for on foot, vehicle, and mouse/options. - Every action has two key slots, and mouse buttons can be bound. - When a key is already bound to another action, the page names that action. - Changes apply and save immediately, and each tab can be reset. - **Frame rate cap** in the F1 menu now applies live. ## Files - `victory-gpu/src/keymap.rs` (new): bindings, defaults, profiles, settings (`VICTORY_BIND_*`, `VICTORY_MOUSE_LOOK`, `VICTORY_MOUSE_INVERT`). - `victory-gpu/src/host/menu/keypage.rs` (new): the page. `menu.rs` adds F2, inverted highlight cells, and key capture. - `victory-hle/src/modules/gameinput.rs`: the stand-in pad is built from the key map, plus mouse look. - `victory-hle/src/modules/lifecycle.rs`: the captured pointer is warped back by default (`VICTORY_MOUSE_WARP=0` turns this off). - `victory-gpu/src/frame.rs`: live frame rate cap. ## Testing - Played on an RTX 4070 / Windows 10: walking, aiming and shooting, entering and leaving cars, driving, rebinding keys. - `cargo test -p victory-hle`: all pass. In `victory-gpu`, the new `keymap`, `keypage`, `menu` and `frame` tests pass. On this Windows 10 machine, a few existing tests that create a D3D12 device crash the test process, in files this PR doesn't touch.
The title registers GameInput callbacks for pads (0x40000) and keyboards
(0x10) only, never for the mouse (0x20), so the emulated mouse did
nothing: no looking around, no shooting. Keyboard and mouse now reach it
through the stand-in pad, by a key map (victory_gpu::keymap):

- Two profiles, on foot and vehicle, since the title's controls differ
  (RT shoots on foot and accelerates in a vehicle). Defaults follow the
  PC layout of the series: WASD, F enter/leave, Space jump/handbrake,
  Shift sprint, Ctrl crouch, Q cover, mouse aim/shoot, W/S accelerate
  and brake in a vehicle, H headlights, E horn, Tab weapon wheel.
- The profile switches on the interact key (not again for 2 s), with
  Caps Lock, and by itself when a freshly pressed key does nothing in
  the profile in use but something in the other (Shift after leaving a
  car). The FPS line shows it (KEYS: ON FOOT / VEHICLE).
- Mouse motion is the right stick (VICTORY_MOUSE_LOOK, up to 2.00);
  what a fast move pushes past full deflection is given over the next
  polls, so the whole move turns the camera. VICTORY_MOUSE_INVERT.
  lifecycle.rs warps the pointer by default (VICTORY_MOUSE_WARP=0 off).

The F1 menu gets a keyboard and mouse page (F2, or the new action):
tabs for on foot, vehicle and mouse/options; every action by name in
groups, two key columns, the cell picked inverted; Enter sets a key or
mouse button, Delete clears, a key already used is named; every change
is in use at once and saved (VICTORY_BIND_FOOT, VICTORY_BIND_VEHICLE,
VICTORY_BIND_SWITCH, VICTORY_BIND_AUTO); a reset per tab. The frame
rate cap now changes live too (frame::set_cap), and the main page shows
the line picked inverted.

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

@⁠siraxe on GitHub · 2026-11-28 00:31 UTC · original · edited 2026-11-28 00:58 UTC

  • Pressing shift to beep in the boat breaks movement
  • Sprint and crouch get messed up and swapped
  • Same for jump and reload
image

I think mode changes to "on foot" at some interaction while still operating vehicle is responsible for 1st issue

**@⁠siraxe** on GitHub · 2026-11-28 00:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7230988494) · edited 2026-11-28 00:58 UTC - Pressing shift to beep in the boat breaks movement - Sprint and crouch get messed up and swapped - Same for jump and reload <img width="842" height="263" alt="image" src="https://github.com/user-attachments/assets/0f4a1f6d-e881-4ac3-aed2-b88b393cdebb" /> I think mode changes to "on foot" at some interaction while still operating vehicle is responsible for 1st issue
Author
Owner

@⁠Moccha-Bee on GitHub · 2026-11-28 00:54 UTC · original

please merge this, game is unplayable otherwise

**@⁠Moccha-Bee** on GitHub · 2026-11-28 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7231276026) please merge this, game is unplayable otherwise
Author
Owner

@⁠kavokat on GitHub · 2026-11-28 01:45 UTC · original

Oh yeah please merge this.

Maybe it could also recognize if the player is in vehicle or on foot and change up controls if needed.

**@⁠kavokat** on GitHub · 2026-11-28 01:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7231901023) Oh yeah please merge this. Maybe it could also recognize if the player is in vehicle or on foot and change up controls if needed.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/menu.rs
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/482/head:github-bot/gh-482'
git switch 'github-bot/gh-482'

Merge

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