Keep keyboard controls working when a controller is connected #74

Open
github-bot wants to merge 2 commits from github-bot/gh-74 into main AGit
Owner

@⁠MiguVT on GitHub · 2026-11-24 21:10 UTC · original
MiguVT:fix/keyboard-with-controller → main · +91 −5 · 2 files · 2 commits · open

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.

**@⁠MiguVT** on GitHub · 2026-11-24 21:10 UTC · [original](https://github.com/fxceless/victory-fork/pull/74) `MiguVT:fix/keyboard-with-controller` → `main` · +91 −5 · 2 files · 2 commits · open ## 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:41 +00:00
Author
Owner

@⁠MiguVT on GitHub · 2026-11-24 22:10 UTC · original

@⁠fxceless check this ^

**@⁠MiguVT** on GitHub · 2026-11-24 22:10 UTC · [original](https://github.com/fxceless/victory-fork/pull/74#issuecomment-7145902640) @⁠fxceless check this ^
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-25 07:54 UTC · original

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.

**@⁠dcastell1** on GitHub · 2026-11-25 07:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/74#issuecomment-7156387833) 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 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/74/head:github-bot/gh-74'
git switch 'github-bot/gh-74'

Merge

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