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

Open
Dyslex1337 wants to merge 5 commits from upstream-pr/482 into main
Dyslex1337 commented 2026-11-27 23:17:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dyslex1337 on 2026-11-27T23:17:39Z.


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 to enter or leave a vehicle, Space to jump or handbrake, Shift to sprint, Ctrl to crouch, Q for cover, the mouse to aim and shoot, W/S to drive, Tab for the weapon wheel. The full table is in the README. Letter keys count by their place, so the layout is ZQSD on AZERTY.
  • 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 goes from 0.01 to 2.00, and Y can be inverted.
  • On foot and vehicle profiles. The pad's controls differ between the two (RT shoots on foot and accelerates in a vehicle), so there is one profile for each.
    • F switches the profile, with a 2 s guard so a second press doesn't switch it back. Caps Lock switches it by hand.
    • A freshly pressed key that only works in the other profile switches to it (Shift after leaving a car), except while driving.
    • 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 its pad button and two key slots; mouse buttons can be bound.
    • Conflicts are named.
    • Changes apply and save immediately, and each tab can be reset.
  • Frame rate cap in the F1 menu now applies live.

Review feedback

  • Shift in a boat broke movement (siraxe): Shift was a key of the on foot profile, so pressing it switched the profile away from the boat. Now, while accelerate, brake or steer is held in the vehicle profile, and for 1.5 s after, no key switches to on foot.
  • Sprint/crouch and jump/reload swapped (siraxe): the action names follow the game's Standard controller layout, and other layouts put these actions on other pad buttons. The page now shows each action's pad button, and the README says to pick Standard in the game's control settings or rebind.
  • Detect vehicle or on foot (kavokat): the title doesn't tell the input layer, so the profile follows the keys: F, Caps Lock, keys that only work in the other profile, and the driving guard above.

Files

  • victory-gpu/src/keymap.rs (new): bindings, defaults, profiles, letters by place, settings (VICTORY_BIND_*, VICTORY_MOUSE_LOOK, VICTORY_MOUSE_INVERT).
  • victory-gpu/src/host/menu/keypage.rs (new): the page. menu.rs gains F2, inverted highlight cells and key capture, next to main's save export and import.
  • victory-hle/src/modules/gameinput.rs: the stand-in pad 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: the live frame rate cap.
  • Four clippy lints that main had (shadow.rs, descriptor.rs, emit/mod.rs, gameinput.rs), so CI's clippy passes.

Testing

  • Played on an RTX 4070 / Windows 10: walking, aiming and shooting, entering and leaving cars, driving, and rebinding on the page.
  • cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings: clean (toolchain 1.98.1).
  • cargo test -p victory-hle: 189 passed. The victory-gpu tests for keymap, keypage, menu and frame: 22 passed, including the driving guard, letters by place and the page layout.
  • On this Windows 10 machine, tests that need an SM 6.6 device (in victory-shader, and some D3D12 ones in victory-gpu) cannot run. They fail the same way without this PR.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5534337665 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482). Originally posted by [Dyslex1337](https://github.com/Dyslex1337) on 2026-11-27T23:17:39Z. --- ## 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-v2.png) ![Mouse and options](https://raw.githubusercontent.com/Dyslex1337/VIctory-NVIDIA/pr-screenshots/mouse-and-options-v2.png) ## Changes - **PC layout by default:** WASD, F to enter or leave a vehicle, Space to jump or handbrake, Shift to sprint, Ctrl to crouch, Q for cover, the mouse to aim and shoot, W/S to drive, Tab for the weapon wheel. The full table is in the README. Letter keys count by their place, so the layout is ZQSD on AZERTY. - **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 goes from 0.01 to 2.00, and Y can be inverted. - **On foot and vehicle profiles.** The pad's controls differ between the two (RT shoots on foot and accelerates in a vehicle), so there is one profile for each. - **F** switches the profile, with a 2 s guard so a second press doesn't switch it back. **Caps Lock** switches it by hand. - A freshly pressed key that only works in the other profile switches to it (Shift after leaving a car), except while driving. - 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 its pad button and two key slots; mouse buttons can be bound. - Conflicts are named. - Changes apply and save immediately, and each tab can be reset. - **Frame rate cap** in the F1 menu now applies live. ## Review feedback - **Shift in a boat broke movement** (siraxe): Shift was a key of the on foot profile, so pressing it switched the profile away from the boat. Now, while accelerate, brake or steer is held in the vehicle profile, and for 1.5 s after, no key switches to on foot. - **Sprint/crouch and jump/reload swapped** (siraxe): the action names follow the game's **Standard** controller layout, and other layouts put these actions on other pad buttons. The page now shows each action's pad button, and the README says to pick Standard in the game's control settings or rebind. - **Detect vehicle or on foot** (kavokat): the title doesn't tell the input layer, so the profile follows the keys: F, Caps Lock, keys that only work in the other profile, and the driving guard above. ## Files - `victory-gpu/src/keymap.rs` (new): bindings, defaults, profiles, letters by place, settings (`VICTORY_BIND_*`, `VICTORY_MOUSE_LOOK`, `VICTORY_MOUSE_INVERT`). - `victory-gpu/src/host/menu/keypage.rs` (new): the page. `menu.rs` gains F2, inverted highlight cells and key capture, next to main's save export and import. - `victory-hle/src/modules/gameinput.rs`: the stand-in pad 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`: the live frame rate cap. - Four clippy lints that `main` had (`shadow.rs`, `descriptor.rs`, `emit/mod.rs`, `gameinput.rs`), so CI's clippy passes. ## Testing - Played on an RTX 4070 / Windows 10: walking, aiming and shooting, entering and leaving cars, driving, and rebinding on the page. - `cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings`: clean (toolchain 1.98.1). - `cargo test -p victory-hle`: 189 passed. The `victory-gpu` tests for `keymap`, `keypage`, `menu` and `frame`: 22 passed, including the driving guard, letters by place and the page layout. - On this Windows 10 machine, tests that need an SM 6.6 device (in `victory-shader`, and some D3D12 ones in `victory-gpu`) cannot run. They fail the same way without this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
siraxe commented 2026-11-28 00:31:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by siraxe on 2026-11-28T00:31:58Z.


  • 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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7230988494 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7230988494). Originally posted by [siraxe](https://github.com/siraxe) on 2026-11-28T00:31:58Z. --- - 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
Moccha-Bee commented 2026-11-28 00:54:15 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Moccha-Bee on 2026-11-28T00:54:15Z.


please merge this, game is unplayable otherwise

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231276026 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7231276026). Originally posted by [Moccha-Bee](https://github.com/Moccha-Bee) on 2026-11-28T00:54:15Z. --- please merge this, game is unplayable otherwise
kavokat commented 2026-11-28 01:45:56 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kavokat on 2026-11-28T01:45:56Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231901023 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7231901023). Originally posted by [kavokat](https://github.com/kavokat) on 2026-11-28T01:45:56Z. --- 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.
tukorneger commented 2026-11-28 09:27:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tukorneger on 2026-11-28T09:27:38Z.


Yeah merge this please, its a PC game now, we cant play without this.
And... THANK YOU guys

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7237253841 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7237253841). Originally posted by [tukorneger](https://github.com/tukorneger) on 2026-11-28T09:27:38Z. --- Yeah merge this please, its a PC game now, we cant play without this. And... THANK YOU guys
xiaotu030202 commented 2026-11-28 10:16:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by xiaotu030202 on 2026-11-28T10:16:31Z.


Can I use the mouse pointer to select settings in the settings interface?And also custom mouse sensitivity, with reminders for some key indicators, like showing 'Shift' to run in the game scene. After all, since it's mapped keys, there might be situations where you don't know which key to press. Of course, I believe you have the skills, really appreciate it!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7237788926 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/482#issuecomment-7237788926). Originally posted by [xiaotu030202](https://github.com/xiaotu030202) on 2026-11-28T10:16:31Z. --- Can I use the mouse pointer to select settings in the settings interface?And also custom mouse sensitivity, with reminders for some key indicators, like showing 'Shift' to run in the game scene. After all, since it's mapped keys, there might be situations where you don't know which key to press. Of course, I believe you have the skills, really appreciate it!
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/482:upstream-pr/482'
git switch 'upstream-pr/482'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/482'
git switch 'upstream-pr/482'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/482'
git switch 'upstream-pr/482'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/482'
git switch 'main'
git merge --squash 'upstream-pr/482'
git switch 'main'
git merge --ff-only 'upstream-pr/482'
git switch 'main'
git merge 'upstream-pr/482'
git push origin 'main'
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!482
No description provided.