Prompts: show the keys of the active keyboard profile #4589

Open
github-bot wants to merge 1 commit from github-bot/gh-4588 into main AGit
Owner

@⁠tyr0nsur on GitHub · 2026-11-30 23:20 UTC · original
tyr0nsur:codex/accurate-keyboard-prompts → main · +153 −105 · 9 files · 1 commits · open

Fixes #4537.

What it changes

With the shipped bindings.ini, the native keyboard path handles Tab for LB and F for Y. The keyboard pictures still show Q and Y on current main. The profile lookup from #2545 was left disconnected from the prompt hook, and the native input path began using the profile's buttons in ffe92c57.

  • Pass the loaded profile to the existing icon renderer before the hook is installed. Native input uses profile buttons with its remaining stock keyboard keys. Legacy input uses the profile's separate axis bindings. Controller modes keep the title's controller prompts.
  • Draw Backspace as a solid erase-left outline with a cut-out cross. It uses the same in-memory vector pipeline as the other keycaps.
  • Show F1–F24 by name in keycaps and the binding editor and accept their names in bindings.ini. Existing host shortcuts still apply. The test uses F5 to avoid the host's F1–F3 shortcuts.

The pictures reflect the profile loaded at launch. A restart is required to refresh them after editing a binding in the menu. Animated hold prompts keep their original art.

This can work with the layout proposed in #4587. This PR reads whichever profile is active and leaves the shipped key assignments in place. It also leaves the movie-load timing from #3442 outside this change.

How it was tested

Windows validation on e23347a0, based on current main f5c3d243 after the F1 menu update in #4635.

  • All 45 victory-game library tests passed. The synthetic movie verifies that only the controls bound to Tab and F5 are redrawn in that case.
  • 96 native keyboard and GameInput tests passed (2 ignored). The focused test for F1, F5, and F24 in the redesigned binding editor also passed.
  • cargo check --locked -p victory and the staged asset-policy check passed for nine files.
  • I inspected the new outline at 64, 32, and 20 pixels using generated geometry. In-game verification is still pending. No game assets are included.

The CI check on this head stops at the same five Clippy findings as main f5c3d243. The fixes are tracked in #4680. The CI test step did not run.

Checked for overlap

Related: #4542, #4587, #3442 and #4635.

**@⁠tyr0nsur** on GitHub · 2026-11-30 23:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4588) `tyr0nsur:codex/accurate-keyboard-prompts` → `main` · +153 −105 · 9 files · 1 commits · open Fixes #4537. ## What it changes With the shipped `bindings.ini`, the native keyboard path handles Tab for LB and F for Y. The keyboard pictures still show Q and Y on current main. The profile lookup from #2545 was left disconnected from the prompt hook, and the native input path began using the profile's buttons in ffe92c57. - Pass the loaded profile to the existing icon renderer before the hook is installed. Native input uses profile buttons with its remaining stock keyboard keys. Legacy input uses the profile's separate axis bindings. Controller modes keep the title's controller prompts. - Draw Backspace as a solid erase-left outline with a cut-out cross. It uses the same in-memory vector pipeline as the other keycaps. - Show F1–F24 by name in keycaps and the binding editor and accept their names in `bindings.ini`. Existing host shortcuts still apply. The test uses F5 to avoid the host's F1–F3 shortcuts. The pictures reflect the profile loaded at launch. A restart is required to refresh them after editing a binding in the menu. Animated hold prompts keep their original art. This can work with the layout proposed in #4587. This PR reads whichever profile is active and leaves the shipped key assignments in place. It also leaves the movie-load timing from #3442 outside this change. ## How it was tested Windows validation on `e23347a0`, based on current main `f5c3d243` after the F1 menu update in #4635. - All 45 `victory-game` library tests passed. The synthetic movie verifies that only the controls bound to Tab and F5 are redrawn in that case. - 96 native keyboard and GameInput tests passed (2 ignored). The focused test for F1, F5, and F24 in the redesigned binding editor also passed. - `cargo check --locked -p victory` and the staged asset-policy check passed for nine files. - I inspected the new outline at 64, 32, and 20 pixels using generated geometry. In-game verification is still pending. No game assets are included. The CI check on this head stops at the same five Clippy findings as main f5c3d243. The fixes are tracked in #4680. The CI test step did not run. ## Checked for overlap Related: #4542, #4587, #3442 and #4635.
Use the parsed launch bindings for static keyboard prompts, draw Backspace with an original erase-left outline, and recognise function keys in prompts and bindings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 23:25:14 +00:00
@ -296,0 +296,4 @@
let bound = b.buttons.iter().filter(|&&(key, on)| {
// The native keyboard sampler sees left/right modifiers and
// keyboard input. Mouse buttons and wheel pulses come another way.
on == bit && (!native_mouse || !matches!(key, 0x01..=0x07 | WHEEL_UP | WHEEL_DOWN | 0x10..=0x12))
Author
Owner

@⁠F0RLE on GitHub · 2026-11-30 23:40 UTC · original

Thanks for wiring the active bindings into the prompts. One small native-mouse case worth covering: bindings.ini accepts Shift, Ctrl and Alt, but the Windows sampler reports the left/right VKs, so this filter leaves those generic bindings unsupported in native mode. For example, A = Shift should let either Shift drive A, without also firing the stock L3 binding.

A small fix is to share a binding matcher between the stand-in button resolver and the prompt builder: exact match, plus VK_SHIFT → VK_LSHIFT/VK_RSHIFT (likewise Ctrl and Alt). Use it both when evaluating custom bindings and when suppressing covered stock bindings/prompts, then allow the generic VKs through this filter. An explicitly left/right binding should still cover only that side.

I tested this approach locally in the stand-in button resolver: all six side-specific inputs produced only the custom button, and remapping just Left Shift left Right Shift's stock mapping intact. The GameInput/MnK unit tests passed (97 passed, 2 ignored).

**@⁠F0RLE** on GitHub · 2026-11-30 23:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4588#discussion_r4747079466) Thanks for wiring the active bindings into the prompts. One small native-mouse case worth covering: `bindings.ini` accepts `Shift`, `Ctrl` and `Alt`, but the Windows sampler reports the left/right VKs, so this filter leaves those generic bindings unsupported in native mode. For example, `A = Shift` should let either Shift drive A, without also firing the stock L3 binding. A small fix is to share a binding matcher between the stand-in button resolver and the prompt builder: exact match, plus `VK_SHIFT` → `VK_LSHIFT`/`VK_RSHIFT` (likewise Ctrl and Alt). Use it both when evaluating custom bindings and when suppressing covered stock bindings/prompts, then allow the generic VKs through this filter. An explicitly left/right binding should still cover only that side. I tested this approach locally in the stand-in button resolver: all six side-specific inputs produced only the custom button, and remapping just Left Shift left Right Shift's stock mapping intact. The GameInput/MnK unit tests passed (97 passed, 2 ignored).
github-bot force-pushed github-bot/gh-4588 from 16d475187b to 2ca8307026 2026-12-01 00:05:11 +00:00 Compare
github-bot force-pushed github-bot/gh-4588 from 2ca8307026 to e23347a03b 2026-12-01 01:41:33 +00:00 Compare
@ -296,0 +296,4 @@
let bound = b.buttons.iter().filter(|&&(key, on)| {
// The native keyboard sampler sees left/right modifiers and
// keyboard input. Mouse buttons and wheel pulses come another way.
on == bit && (!native_mouse || !matches!(key, 0x01..=0x07 | WHEEL_UP | WHEEL_DOWN | 0x10..=0x12))
Author
Owner

@⁠F0RLE on GitHub · 2026-12-01 09:59 UTC · original

Follow-up: I opened #4628 for the input-side fix discussed here. With a binding like A = Shift, either physical Shift key triggers A without also firing the stock button. The same applies to generic Ctrl and Alt bindings. #4628 leaves the on-screen prompts unchanged.

**@⁠F0RLE** on GitHub · 2026-12-01 09:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4588#discussion_r4752256588) Follow-up: I opened #4628 for the input-side fix discussed here. With a binding like `A = Shift`, either physical Shift key triggers A without also firing the stock button. The same applies to generic Ctrl and Alt bindings. #4628 leaves the on-screen prompts unchanged.
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/4589/head:github-bot/gh-4588'
git switch 'github-bot/gh-4588'

Merge

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