Skip to content

Keep keyboard controls working when a controller is connected - #74

Open
MiguVT wants to merge 2 commits into
fxceless:mainfrom
MiguVT:fix/keyboard-with-controller
Open

MiguVT wants to merge 2 commits into
fxceless:mainfrom
MiguVT:fix/keyboard-with-controller

Conversation

@MiguVT

@MiguVT MiguVT commented Nov 24, 2026

Copy link
Copy Markdown

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 AI balanced review requested due to automatic review settings November 24, 2026 21:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

MiguVT commented Nov 24, 2026

Copy link
Copy Markdown
Author

@fxceless check this ^

@dcastell1

Copy link
Copy Markdown

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.

PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
The picked PRs met here: fxceless#105 builds test keys with `key_at(virtual
key, scan code)`, as letters now go by place, so fxceless#74's test of the
keyboard on the first connected pad does too. fxceless#341's migration test
names the version by its folder, as 3cdaf7d's tests do since
`Version::number` became `highest`.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
7838a1d's walk test pressed W while a pad was connected. Since fxceless#74 the
keyboard also drives the first connected pad, so W added a reading of
that pad between the walk's steps; M is no control of the stand-in pad.
The key is built with its US place, as fxceless#105's tests do.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…ess#653: XMA audio hangs, XAsync, saves, window close, loader lock), input (fxceless#640 taps, fxceless#105 keys by place: ZQSD on AZERTY, fxceless#74 keyboard with XInput devices), saves and services, DirectStorage (fxceless#575 AutoSubmitDisabled), loader, tooling

# Conflicts:
#	crates/victory-hle/src/modules/dstorage.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants