Input: a receiver answering for a switched-off pad hides the keyboard stand-in (fix on a fork) #845
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#845
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Numbers-iwnl on GitHub · 2026-11-24 12:14 UTC · original
Symptom. With a wireless receiver plugged in and its pad switched off, the keyboard never reaches the title.
XInputGetStateanswers for the dead pad, sohost::pad()returnsSome(PadState::default()),State::pollsetsany_pad = true, and the keyboard's stand-in pad is never connected.host::keys()still reads the keyboard while our window has focus, but the stand-in is the only device that carries those keys, so nothing arrives.Measured on Windows 11 26300, RX 9070 XT, main
ffe310e, diag build:keybd_event, ENTER/X/Y) with the title in true foreground (ALT unlock, then ESC to dismiss the system menu ALT opens,GetForegroundWindow()confirmed equal to the title's hwnd): account picker and wizard do not react.VICTORY_KEYS=…:Enter,…in the diag build fires on schedule and produces no visible change either.Rule proposed (branch below): a host slot is a pad once it has reported anything other than rest, and stays a pad after that. A slot that has only ever reported rest is not one.
Fix on a fork
Branch:
Numbers-iwnl/VIctory@fix/idle-receiver-keyboard, commit517f277, based onorigin/mainffe310e. One file,crates/victory-hle/src/modules/gameinput.rs:State::seen_input: [bool; PADS], set when a slot reports non-rest input.State::pollfilters each slot through it before computingany_padand beforeupdate().modules::gameinput::tests::a_receiver_with_a_switched_off_pad_does_not_hide_the_keyboard_stand_in: an all-zero slot leaves the stand-in connected and reportsDEVICE_DISCONNECTEDfor the slot; the first press connects the pad and disconnects the stand-in; a pad back at rest stays connected with no further callbacks.unregistering_waits_for_a_running_callbackseeded an all-zero pad and waited for its connect callback, which the new rule no longer sends; it presses a button now.Tests
cargo test -p victory-hle -- --test-threads=4: 95 passed, 0 failed, 0 ignored.cargo test -p victory-shader --lib: 120 passed, 0 failed, 1 ignored (unchanged, run for the asset-policy hook).Not tested
AI use
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 12:26 UTC · original
I tested a follow-up case on
517f277with the existing fake GameInput host. A pad reports input in slot 0, the host reports that slot disconnected, and a neutral receiver then appears in the same slot. The remembered input carries across the disconnect, so the neutral slot takes over and the keyboard stand-in disappears again.Clearing
seen_inputwhen the host reports a disconnect makes it apply to the current connection. In the regression test, Enter now reaches the stand-in as A after the neutral reconnect. The original idle-receiver test and all 96victory-hlelibrary tests passed on Windows.AI-assisted. Verified with synthetic GameInput states, including an explicit disconnect.
Incremental patch on
517f277@Numbers-iwnl on GitHub · 2026-11-24 12:42 UTC · original
Case confirmed and applied on the branch.
A slot that reported input, disconnected and came back neutral kept the flag set, so a receiver that re-paired without a pad took the stand-in away again. The flag now clears when the host reports the slot disconnected, which makes it apply to the current connection only.
Numbers-iwnl/VIctory@fix/idle-receiver-keyboard, headc8ab89c(onffe310e)crates/victory-hle/src/modules/gameinput.rs: the disconnect branch of the slot filter resets the flag; the struct comment says soa_reconnected_idle_slot_does_not_hide_the_keyboard_stand_inis included as posted, withCo-authored-byon the commitcargo test -p victory-hle -- --test-threads=4: 96 passed, 0 failed, 0 ignored — botha_receiver_with_a_switched_off_pad_does_not_hide_the_keyboard_stand_inand the reconnected case passStill no title run on this branch, so the end-to-end case remains unit-level evidence.
AI-assisted — agent: yes.
@Louisreed on GitHub · 2026-11-24 13:25 UTC · original
Independently verified the updated head
c8ab89c(fix/idle-receiver-keyboard, baseffe310e, which is stillmain) on Windows 10 22H2 (19045), Rust 1.98.1 MSVC.cargo test -p victory-hle --locked: 96 unit + 1 integration passed, 0 failed.main(test module swapped in,main's code):a_receiver_with_a_switched_off_pad_does_not_hide_the_keyboard_stand_in: "an all-zero slot is not a pad".a_reconnected_idle_slot_does_not_hide_the_keyboard_stand_in: fails at the first stand-in assertion.-D warningsandcargo xtask policy(154 files ok) are clean.rustfmt --check gameinput.rsreports one hunk at line ~838 (hub.returned.wait(...)), but it's outside this diff and also present onmain.The diff reads correctly:
seen_inputis set on non-rest input and cleared onNone, and it filters slots beforeany_pad, so the stand-in decision andupdate()see the same view. The edit tounregistering_waits_for_a_running_callbackkeeps that test's intent.One observation, not tested: an idle pad now connects on the same poll as its first press, so a title that only starts reading a device after its connect callback could miss that press. This only matters if titles behave that way. The branch's unit tests can't show it either way.
Not tested: any title or real receiver. Synthetic GameInput states only, no game data.
AI-assisted (Claude). I ran the checks locally.
@Numbers-iwnl on GitHub · 2026-11-24 13:33 UTC · original
On the missed-press observation: tested at the poll level, head now
a6884a3.the_first_press_is_still_current_after_the_connect_callback: the press that makes an idle slot a pad arrives in the same poll as the connect callback, and that reading stays current until the pad reports something else. A title that only starts reading after its callback gets the pressed state on its next read; the release then produces a new reading.The residual case is narrower than "a title that reads late": a press that starts and ends between two polls is lost, which is true of any poll-level input path and not something this branch can change. No title run either way, so the callback-ordering question stays open until something drives the first-boot screens through it.
a6884a3onNumbers-iwnl/VIctory@fix/idle-receiver-keyboardcargo test -p victory-hle -- --test-threads=4: 97 passed, 0 failed, 0 ignoredAI-assisted — agent: yes.
@Numbers-iwnl on GitHub · 2026-11-24 14:04 UTC · original
Status of the tree, for anyone reading the reference above.
Commit
88196f77("Wave 7: …") references this issue and carries the sameseen_inputrule, but it is not onmain:mainatffe310ehas noseen_inputincrates/victory-hle/src/modules/gameinput.rs, and no branch head or open pull request carries that commit (commits/88196f77/branches-where-headis empty, andcompare/ffe310e...88196f77reports it 18 commits ahead on a line of its own).So the fork branch in the description —
Numbers-iwnl/VIctory@fix/idle-receiver-keyboard, heada6884a3— remains the only tree with the change, at 97 passingvictory-hletests.AI-assisted — agent: yes.
@BaggyALPHA on GitHub · 2026-11-24 15:55 UTC · original
Live compatibility check of the input changes at
a6884a3on top of the Series S presentation fix from #211. WARP, fresh test profile, physical Xbox controller, and no scripted input.With the controller switched off, XInput reported no connected slots. In the title, the keyboard's stand-in pad connected and Enter advanced the Player prompt. During setup the controller was turned back on. VIctory reported the real pad connected and the stand-in disconnected, and the setup screen advanced after reconnection.
This covers a normal disconnect and reconnect in the title. The switched-off controller on this setup did not leave a neutral XInput slot connected, so the specific receiver behavior in the issue remains unverified live. All nine GameInput unit tests passed on the unmodified
a6884a3fork, including the neutral receiver, reconnect, and first-press cases.AI-assisted test execution and write-up (OpenAI Codex).
@MamaLeVrai on GitHub · 2026-11-24 19:45 UTC · original
@Numbers-iwnl your fix for this issue is now in a pull request, #1610, with seven other fixes from contributors' forks: the branch is merged as it is, with your commit(s) and your name unchanged, onto
mainffe310e. Clippy (both runs) andcargo test --workspacepass on the result. If you would rather open your own pull request for this one, say so and I will take it out of #1610. AI-assisted (Claude Code); no game data.@Marvisak on GitHub · 2026-11-25 03:55 UTC · original
Automated triage for the maintainers.
Confirmed on current
main: incrates/victory-hle/src/modules/gameinput.rs,State::pollsetsany_padas soon as any host slot answers (pads.iter().any(Option::is_some)) and feeds the keyboard stand-in (FALLBACK) only when none does. A receiver that reports a switched-off pad at rest therefore hides the keyboard, as described.Bundle #1610, which carried your branch, was closed without being merged, so the change is not on
main. Open PR #1430 (for the related #729) also keeps the stand-in while XInput slots are idle. Pull requests are open to everyone again (see #717), so please open your branch (a6884a3) as a PR, or compare it with #1430 and comment there if one approach covers both cases.Generated by Claude Code