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

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

@⁠MamaLeVrai on GitHub · 2026-11-25 10:02 UTC · original
MamaLeVrai:keys-anywhere → main · +53 −1 · 2 files · 1 commits · open

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

**@⁠MamaLeVrai** on GitHub · 2026-11-25 10:02 UTC · [original](https://github.com/fxceless/victory-fork/pull/839) `MamaLeVrai:keys-anywhere` → `main` · +53 −1 · 2 files · 1 commits · open ## 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)
The keyboard stand-in pad is read only while the foreground window belongs to our process.
When it does not, nothing says 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 pad's
table is down while the keyboard is not being read, and VICTORY_KEYS_ANYWHERE=1 (unset, empty
or 0 is off) reads the keyboard whichever window has the focus, which also tells the two apart.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:52:16 +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/839/head:github-bot/gh-839'
git switch 'github-bot/gh-839'

Merge

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