F1 key bindings: a wait for a key ends when the game window is not in front #4969
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4969
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4968"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@eipastel on GitHub · 2026-12-01 15:50 UTC · original
eipastel:fix/f1-binding-focus→main· +76 −7 · 1 files · 1 commits · open[pr-fix] Fixes point 2 of #4940.
What it changes
In F1 → KEY BINDINGS, a wait for a key read
GetAsyncKeyState, which answers for the whole desktop. After Alt+Tab (or a click on another window) during the wait, the next key typed in the other program was written tobindings.ini. #2245 (9e0c369db) ended the wait as soon as the game window was not in front; the #4635 rewrite ofmenu.rsleft that out (#4940, point 2).This brings it back on the new menu, nearly as it was:
binds::Binds::heardreturnsHeard::{Nothing, Key, Lost};heard_fromtakes "a window of ours is in front" and the key reader, and ends the wait withLostbefore reading any key when we are not in front.hear_bindingshowsNOT CHANGED: THE GAME WINDOW WAS NOT IN FRONTforLostand binds nothing.a_wait_for_a_key_ends_when_the_window_is_not_in_frontcomes back (adapted:Bindsis built in the test, as there is noBinds::ofany more).Points 1, 3, 4 and 5 of #4940 are not touched here (3 and 5: #4943 and #4951; 4: #2868).
How it was tested
cargo test -p victory-gpu --lib host::menu: the new test passes.cargo clippy -p victory-gpu --all-targets -- -D warnings: only the five errors already onmain(font.rs, menu.rs:667, panel.rs; #4680 / #4708), none in the changed lines.cargo xtask policy --stagedpasses.Checked for overlap
menu.rs; none of their diffs adds a focus check to the binding wait (searched forfocused(),heard,NOT IN FRONT).🤖 Generated with Claude Code
github-bot referenced this pull request2026-12-01 16:12:28 +00:00
@cloph-dsp on GitHub · 2026-12-01 18:05 UTC · original
Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.
Base
5fabb46eaf6ed8771321787f8871051abde69b9b, headcb586d1d038300d4619ed4263b1be50125b71a0f.git diff --numstat→ crates/victory-gpu/src/host/menu.rs 76/7.a_wait_for_a_key_ends_when_the_window_is_not_in_frontis new on the base (git grep -F a_wait_for_a_key_ends_when_the_window_is_not_in_front 5fabb46e -- .→ no match, exit 1).whole_view_above_window-style helper changes in the same hunk are production code, not tests.git diff --check "5fabb46e..cb586d1d"→ no output, exit 0.Result:
running 1 test,test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1161 filtered out; finished in 0.00s.What the test actually pins, since it is worth being precise: it drives
Binds::heard_from(ours, held)with a closure, so no OS input is read. The cases are — no wait in progress →Heard::Nothingand the closure panics if called; waiting and in front with nothing held →Nothingand the wait survives; Esc while waiting →Nothing(Esc is not bindable) and the wait still survives;Ewhile waiting →Heard::Key(b'E')andwaitingis cleared; waiting while another program is in front →Heard::Lost, the wait is cleared, and the closure is never called; back in front afterwards →Nothing. It closes by reading the binding back (value("Y") == "F").So it covers the new "not in front ends the wait" branch and that the branch does not consume a key. No device, GPU/driver N/A. No game data.
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.Merge
Merge the changes and update on Forgejo.