Input: say why a stand-in pad key is ignored; VICTORY_KEYS_ANYWHERE=1 reads the keyboard without the focus #838

Open
MamaLeVrai wants to merge 1 commit from upstream-pr/839 into main
MamaLeVrai commented 2026-11-25 10:02:50 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T10:02:50Z.


What

The keyboard stand-in pad (used when no XInput pad is connected) is read only while the foreground window belongs to our process (focused() in gameinput.rs). When it does not, nothing says so, so a tester whose keys do nothing cannot tell a focus problem from a broken stand-in.

  • With VICTORY_LOG=info, the log now says once that a key of the stand-in pad's table (the README's list, plus W A S D I J K L Z C) is down while the keyboard is not being read, and what to do about it.
  • VICTORY_KEYS_ANYWHERE=1 (unset, empty or 0 is off) reads the keyboard whichever window has the focus. It also tells the two cases apart: if the keys work with it and not without it, the focus test is the cause. The caveat is in the README: typing in another window then reaches the title too.
  • README: a short note under the key table.

Nothing changes when the switch is not set, apart from the one log line.

Why

A tester on an RX 6950 XT (Windows 11, no gamepad) reported that the keyboard stand-in worked about once in a hundred tries, even for the legal-notice screen that needs scrolling, while the scripted keys of VICTORY_KEYS (which ignore the focus) worked. I could not find the cause from the code (the window is created with WS_OVERLAPPEDWINDOW | WS_VISIBLE, no NOACTIVATE), so this PR does not claim a fix: it makes the next report say whether focus is the reason.

Checks

  • cargo test -p victory-hle (99 tests, one new: a_switch_is_on_unless_unset_empty_or_zero): pass, on an RX 6950 XT, Windows 11.
  • cargo clippy -p victory-hle --all-targets --no-deps -- -D warnings: clean. (main itself fails cargo clippy --workspace -D warnings in victory-gpu with two dead-code errors, placed_filler_twins and depth_written, with or without this PR.)
  • Not tested in the title: the keyboard path needs the real window and I did not run the game.

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6601935245 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/839). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T10:02:50Z. --- ## What The keyboard stand-in pad (used when no XInput pad is connected) is read only while the foreground window belongs to our process (`focused()` in `gameinput.rs`). When it does not, nothing says so, so a tester whose keys do nothing cannot tell a focus problem from a broken stand-in. - With `VICTORY_LOG=info`, the log now says **once** that a key of the stand-in pad's table (the README's list, plus W A S D I J K L Z C) is down while the keyboard is not being read, and what to do about it. - `VICTORY_KEYS_ANYWHERE=1` (unset, empty or `0` is off) reads the keyboard whichever window has the focus. It also tells the two cases apart: if the keys work with it and not without it, the focus test is the cause. The caveat is in the README: typing in another window then reaches the title too. - README: a short note under the key table. Nothing changes when the switch is not set, apart from the one log line. ## Why A tester on an RX 6950 XT (Windows 11, no gamepad) reported that the keyboard stand-in worked about once in a hundred tries, even for the legal-notice screen that needs scrolling, while the scripted keys of `VICTORY_KEYS` (which ignore the focus) worked. I could not find the cause from the code (the window is created with `WS_OVERLAPPEDWINDOW | WS_VISIBLE`, no `NOACTIVATE`), so this PR does not claim a fix: it makes the next report say whether focus is the reason. ## Checks - `cargo test -p victory-hle` (99 tests, one new: `a_switch_is_on_unless_unset_empty_or_zero`): pass, on an RX 6950 XT, Windows 11. - `cargo clippy -p victory-hle --all-targets --no-deps -- -D warnings`: clean. (`main` itself fails `cargo clippy --workspace -D warnings` in `victory-gpu` with two dead-code errors, `placed_filler_twins` and `depth_written`, with or without this PR.) - Not tested in the title: the keyboard path needs the real window and I did not run the game. AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
copilot-pull-request-reviewer[bot commented 2026-11-25 10:11:08 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T10:03:04Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:fxceless/victory-fork:review:6055471869 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/839#pullrequestreview-6055471869). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer%5Bbot%5D) on 2026-11-25T10:03:04Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
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/839:upstream-pr/839'
git switch 'upstream-pr/839'

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/839'
git switch 'upstream-pr/839'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/839'
git switch 'upstream-pr/839'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/839'
git switch 'main'
git merge --squash 'upstream-pr/839'
git switch 'main'
git merge --ff-only 'upstream-pr/839'
git switch 'main'
git merge 'upstream-pr/839'
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
fxceless/victory-fork!838
No description provided.