Key-driven stick strength on the map and in menus (VICTORY_KEY_STICK_MENU, 0.5 by default) #4583

Open
github-bot wants to merge 2 commits from github-bot/gh-4582 into main AGit
Owner

@⁠Jesper-Andersson on GitHub · 2026-11-30 23:12 UTC · original
Jesper-Andersson:up-mapkeys → main · +125 −10 · 4 files · 2 commits · open

No issue: a small input feature.

What it changes

With mouse and keyboard, a key gives the stick a full push (1.0). On the map and in menus that moves the selection far too fast to stop where you want.

New switch VICTORY_KEY_STICK_MENU (0.1 to 1.0; unset or invalid = 0.5; 1 = the full push, as before), read from the environment on first use and changed live by an F1 item MAP KEY SPEED (0.25, 0.4, 0.5 (default), 0.75, 1). While mousehook::is_menu_or_paused() is true, the stick values that keys produce are multiplied by the factor:

  • the fixed key map in fallback_for_seat (both sticks);
  • the legacy mouse and keyboard sampler (mnk::sample()), left stick only, since its right stick is the mouse.

Gamepad sticks, VICTORY_MOUSE_STICK, triggers and buttons are not changed, and nothing changes on foot. The scaling is a pure function, scale_key_sticks(), with a unit test, and the default and bounds of the switch have unit tests too. On by default at 0.5: a player with mouse and keyboard gets a slower map selection without setting anything; VICTORY_KEY_STICK_MENU=1 restores today's speed.

How it was tested

  • GPU and profile: RTX 2070 SUPER 8 GB, driver 621.40, Windows 11, Series S, mouse and keyboard, ray tracing off.
  • Before (on our fork's build): holding a WASD key on the map moved the selection too fast to stop on a point.
  • After, on our fork's build (the same change wired into our own unmerged key-bindings path, FSR 3 frame generation x2): 0.4 felt right (one player's impression, not measured).
  • After, on this branch itself (2026-12-01, Release build of bc63e9518 = main 5fabb46ea + this change, started with VICTORY_KEY_STICK_MENU=0.4, without DLSS and without frame generation, shaders still compiling for much of the session): the map works with it, WASD moves the selection slower on the map and in menus, and comparing the F1 values live, 0.5 felt right (one player's impression, not measured). No panic in the log. So 0.5 is now the default (831d53f6c); that last commit only changes the default, the F1 label and docs, and was not run in the game itself.
  • Not tested: other GPUs, AMD, Series X, a real gamepad on the map.
  • For shader changes, the wave sizes tested: no shader changes.
  • cargo test passed for the crates it touches: yes, on 831d53f6c (main 5fabb46ea + this PR): cargo test --locked -p victory-hle --lib key_stick 1 passed; cargo test --locked -p victory-gpu --lib key_stick_menu 2 passed; cargo test --locked -p victory-gpu --lib menu 2 passed. cargo clippy -p victory-gpu --all-targets --locked -- -D warnings reports 5 errors, none on this PR's lines (font.rs 213 and 260, panel.rs 602 and 668, menu.rs 673). victory-hle could not be linted on its own, since it builds on victory-gpu. So CI's clippy step may still fail on main's own lints.

Spec dependence

  • Likely general: this is CPU-side input code with no shader change; it only touches the stick values keys produce while the map or a menu is up.
  • May depend on our setup: the default (0.5) was judged by one player on one PC (RTX 2070 SUPER 8 GB, Turing, ReBAR off, Ryzen 7 5800X, 32 GB RAM) at a low frame rate. Whether it feels right at other frame rates is untested; F1 changes it live.
  • Untested elsewhere: other GPUs, AMD, Series X, ray tracing on, a real gamepad on the map.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1739, #2869, #4260, #1570, #989 (open mouse and keyboard work in gameinput.rs, mnk.rs and the F1 menu; #652, listed before, is closed). None slows the key-driven sticks on the map. This scales only the stick values keys produce while the map or a menu is up. In git merge-tree against #4260's head, gameinput.rs and mnk.rs merge cleanly; menu.rs conflicts, but #4260 conflicts there with current main alone too. #1739 would replace the mnk.rs sampler this also scales; whichever lands second needs a small rebase there.

Drafted with AI assistance (Claude Code).

**@⁠Jesper-Andersson** on GitHub · 2026-11-30 23:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4582) `Jesper-Andersson:up-mapkeys` → `main` · +125 −10 · 4 files · 2 commits · open No issue: a small input feature. ## What it changes With mouse and keyboard, a key gives the stick a full push (1.0). On the map and in menus that moves the selection far too fast to stop where you want. New switch `VICTORY_KEY_STICK_MENU` (0.1 to 1.0; **unset or invalid = 0.5**; `1` = the full push, as before), read from the environment on first use and changed live by an F1 item MAP KEY SPEED (0.25, 0.4, 0.5 (default), 0.75, 1). While `mousehook::is_menu_or_paused()` is true, the stick values that keys produce are multiplied by the factor: - the fixed key map in `fallback_for_seat` (both sticks); - the legacy mouse and keyboard sampler (`mnk::sample()`), left stick only, since its right stick is the mouse. Gamepad sticks, `VICTORY_MOUSE_STICK`, triggers and buttons are not changed, and nothing changes on foot. The scaling is a pure function, `scale_key_sticks()`, with a unit test, and the default and bounds of the switch have unit tests too. **On by default at 0.5**: a player with mouse and keyboard gets a slower map selection without setting anything; `VICTORY_KEY_STICK_MENU=1` restores today's speed. ## How it was tested - GPU and profile: RTX 2070 SUPER 8 GB, driver 621.40, Windows 11, Series S, mouse and keyboard, ray tracing off. - Before (on our fork's build): holding a WASD key on the map moved the selection too fast to stop on a point. - After, on our fork's build (the same change wired into our own unmerged key-bindings path, FSR 3 frame generation x2): 0.4 felt right (one player's impression, not measured). - After, on this branch itself (2026-12-01, Release build of bc63e9518 = main 5fabb46ea + this change, started with `VICTORY_KEY_STICK_MENU=0.4`, without DLSS and without frame generation, shaders still compiling for much of the session): the map works with it, WASD moves the selection slower on the map and in menus, and comparing the F1 values live, 0.5 felt right (one player's impression, not measured). No panic in the log. So 0.5 is now the default (831d53f6c); that last commit only changes the default, the F1 label and docs, and was not run in the game itself. - Not tested: other GPUs, AMD, Series X, a real gamepad on the map. - For shader changes, the wave sizes tested: no shader changes. - `cargo test` passed for the crates it touches: yes, on 831d53f6c (main 5fabb46ea + this PR): `cargo test --locked -p victory-hle --lib key_stick` 1 passed; `cargo test --locked -p victory-gpu --lib key_stick_menu` 2 passed; `cargo test --locked -p victory-gpu --lib menu` 2 passed. `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` reports 5 errors, none on this PR's lines (`font.rs` 213 and 260, `panel.rs` 602 and 668, `menu.rs` 673). `victory-hle` could not be linted on its own, since it builds on `victory-gpu`. So CI's clippy step may still fail on main's own lints. ## Spec dependence - Likely general: this is CPU-side input code with no shader change; it only touches the stick values keys produce while the map or a menu is up. - May depend on our setup: the default (0.5) was judged by one player on one PC (RTX 2070 SUPER 8 GB, Turing, ReBAR off, Ryzen 7 5800X, 32 GB RAM) at a low frame rate. Whether it feels right at other frame rates is untested; F1 changes it live. - Untested elsewhere: other GPUs, AMD, Series X, ray tracing on, a real gamepad on the map. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1739, #2869, #4260, #1570, #989 (open mouse and keyboard work in `gameinput.rs`, `mnk.rs` and the F1 menu; #652, listed before, is closed). None slows the key-driven sticks on the map. This scales only the stick values keys produce while the map or a menu is up. In `git merge-tree` against #4260's head, `gameinput.rs` and `mnk.rs` merge cleanly; `menu.rs` conflicts, but #4260 conflicts there with current main alone too. #1739 would replace the `mnk.rs` sampler this also scales; whichever lands second needs a small rebase there. Drafted with AI assistance (Claude Code).
Keys give a full stick push (1.0), which moves the map selection far too
fast. New switch VICTORY_KEY_STICK_MENU (0.1..1.0, unset/invalid = 1.0 = off,
read live): while is_menu_or_paused() the key-driven sticks (fixed key map,
left stick of the legacy mouse and keyboard sampler) are multiplied by it.
Gamepad sticks, mouse stick, triggers and buttons are untouched. F1 gets a
live MAP KEY SPEED item. Pure scale_key_sticks() with unit tests.

Port of our commit 8ed9b115b onto upstream main.

This change was made with AI assistance (Claude Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 23:14:02 +00:00
github-bot force-pushed github-bot/gh-4582 from 137c6fb8e9 to bc63e95187 2026-12-01 04:14:04 +00:00 Compare
VICTORY_KEY_STICK_MENU now defaults to 0.5 when unset or invalid; `1`
gives the old full push. Run in the game on this branch: the map works with
it, and 0.5 felt right on the map and in menus (one player's impression).
The F1 MAP KEY SPEED item shows the unset value as "0.5 (DEFAULT)". Unit
tests for the default and the bounds.

This change was made with AI assistance (Claude Code).
github-bot changed title from Key-driven stick strength on the map and in menus (VICTORY_KEY_STICK_MENU, off by default) to Key-driven stick strength on the map and in menus (VICTORY_KEY_STICK_MENU, 0.5 by default) 2026-12-01 14:06:10 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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