Keep keyboard controls working when a controller is connected #74

Open
MiguVT wants to merge 2 commits from upstream-pr/74 into main
MiguVT commented 2026-11-24 21:10:24 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MiguVT on 2026-11-24T21:10:24Z.


Summary

  • Merge keyboard gamepad controls into the first connected XInput pad, including when it is not slot zero.
  • Preserve physical buttons and axes; restore controller values when keys are released.
  • Keep the existing stand-in pad when no physical controller is connected.
  • Add regression coverage and update the README input description.

Based directly on upstream main: independent of Linux workflow PR #64, with only the input fix, tests and input documentation.

Validation

  • All 7 GameInput tests passed as Windows binaries under GE-Proton11-14.
  • Windows release cross-build passed.
  • Targeted Windows Clippy with all targets and warnings denied passed.
  • Native Linux test compilation was blocked by existing Windows-only imports in victory-loader; tests were cross-compiled and run under Proton instead.

This fixes keyboard suppression when a controller is connected. The separately reported physical Xbox controller input failure remains under investigation.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6591481437 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/74). Originally posted by [MiguVT](https://github.com/MiguVT) on 2026-11-24T21:10:24Z. --- ## Summary - Merge keyboard gamepad controls into the first connected XInput pad, including when it is not slot zero. - Preserve physical buttons and axes; restore controller values when keys are released. - Keep the existing stand-in pad when no physical controller is connected. - Add regression coverage and update the README input description. Based directly on upstream main: independent of Linux workflow PR #64, with only the input fix, tests and input documentation. ## Validation - All 7 GameInput tests passed as Windows binaries under GE-Proton11-14. - Windows release cross-build passed. - Targeted Windows Clippy with all targets and warnings denied passed. - Native Linux test compilation was blocked by existing Windows-only imports in victory-loader; tests were cross-compiled and run under Proton instead. This fixes keyboard suppression when a controller is connected. The separately reported physical Xbox controller input failure remains under investigation.
copilot-pull-request-reviewer[bot commented 2026-11-24 21:30:30 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T21:10:37Z.

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:6047465678 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/74#pullrequestreview-6047465678). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer%5Bbot%5D) on 2026-11-24T21:10:37Z. **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.
MiguVT commented 2026-11-24 23:09:31 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MiguVT on 2026-11-24T22:10:38Z.


@fxceless check this ^

<!-- greyfinch-sync:fxceless/victory-fork:comment:7145902640 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/74#issuecomment-7145902640). Originally posted by [MiguVT](https://github.com/MiguVT) on 2026-11-24T22:10:38Z. --- @fxceless check this ^
dcastell1 commented 2026-11-25 08:09:05 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by dcastell1 on 2026-11-25T07:54:34Z.


This fixes a hard boot blocker on a USB pad that enumerates as player two. Verified on native Windows, RTX 5090 (driver 621.24), Windows 11 10.0.26300, diag build.

Before (main at 8dd30ab, USB pad in slot 1, slot 0 empty): the guest shell profile card (select profile / player A) never took a button. VICTORY_KEYS presses only reach a pad in slot 0 (Source::pad gates on slot == 0), and the keyboard stand-in pad only exists when no pad is connected anywhere, so with the pad plugged in there was no path at all: the title sat at 13 draws/frame, 30 fps, 1.4 ms GPU, indefinitely. Sending real Enter with the window focused did not help either, which fits the keyboard never reaching that card.

With this branch (4916c1b on 8dd30ab): cargo test -p victory-hle → 99 passed, 0 failed, including keyboard_supplements_first_connected_pad_and_releases_cleanly. Boot becomes deterministic: world in ~2 min, 4,691 draws/frame, 2.5 fps / 392 ms, no input loss on the way.

Same tree without the branch, same .bat, same session: 13 draws forever. So on this box this is not a nicety, it is the difference between usable and not.

A related data point for the default path: VICTORY_CARD_FETCH_INFLIGHT=1 does not just slow things down here, it hangs the same profile card for 5 minutes straight (reported in #648 with the paired control).

Counts only; no game data.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7156387833 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/74#issuecomment-7156387833). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-25T07:54:34Z. --- This fixes a hard boot blocker on a USB pad that enumerates as player two. Verified on native Windows, RTX 5090 (driver 621.24), Windows 11 10.0.26300, diag build. **Before** (main at 8dd30ab, USB pad in slot 1, slot 0 empty): the guest shell profile card (`select profile / player A`) never took a button. `VICTORY_KEYS` presses only reach a pad in slot 0 (`Source::pad` gates on `slot == 0`), and the keyboard stand-in pad only exists when **no** pad is connected anywhere, so with the pad plugged in there was no path at all: the title sat at 13 draws/frame, 30 fps, 1.4 ms GPU, indefinitely. Sending real Enter with the window focused did not help either, which fits the keyboard never reaching that card. **With this branch** (`4916c1b` on `8dd30ab`): `cargo test -p victory-hle` → **99 passed, 0 failed**, including `keyboard_supplements_first_connected_pad_and_releases_cleanly`. Boot becomes deterministic: world in ~2 min, **4,691 draws/frame, 2.5 fps / 392 ms**, no input loss on the way. Same tree without the branch, same .bat, same session: 13 draws forever. So on this box this is not a nicety, it is the difference between usable and not. A related data point for the default path: `VICTORY_CARD_FETCH_INFLIGHT=1` does not just slow things down here, it hangs the same profile card for 5 minutes straight (reported in #648 with the paired control). Counts only; no game data.
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/74:upstream-pr/74'
git switch 'upstream-pr/74'

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