Expose the scripted keyboard as GameInput pad 0 when no controller is connected #1175

Open
github-bot wants to merge 1 commit from github-bot/gh-1175 into main AGit
Owner

@⁠BradRoland on GitHub · 2026-11-25 22:48 UTC · original
BradRoland:codex/scripted-pad-slot-zero → main · +164 −15 · 2 files · 1 commits · open

In #1167 the game’s profile selector ignored VICTORY_KEYS for five minutes with no controller plugged in. A local diagnostic experiment got past the screen by keeping pad 0 connected even between scripted keypresses. On main, a synthetic GameInput client that registers a pad callback receives device 4 in this case and cannot read pad 0.

When a Windows diagnostics build has a valid VICTORY_KEYS schedule and all hardware pad slots are empty, the existing keyboard stand-in now occupies GameInput slot 0 for the duration, including gaps between keys. It retains the keyboard mappings for buttons, sticks and triggers. Plugging in a physical controller restores that controller’s input, and a real pad 0 takes over the same logical device. Rumble is forwarded only when a physical pad is available for that slot. The script clock starts at the first input sample, so a 0:Enter press survives a slow initial hardware poll. Empty and invalid schedules use the existing fallback device.

The regression drives the parsed key schedule with a synthetic clock and fake source. It checks stable device identity and callbacks, keyboard and pad readings on press and release, plugging and unplugging two different controller slots, and rumble routing. It failed on the original slot-4 enumeration. Reproduce with cargo test --locked -p victory-hle --features diagnostics scripted_keys_keep_slot_zero -- --nocapture.

The Windows HLE crate passed 101 unit tests plus its integration test with diagnostics. Its ordinary build passed 100 unit tests plus its integration test. The profile screen still needs a title replay on this commit. AI-assisted implementation and testing.

**@⁠BradRoland** on GitHub · 2026-11-25 22:48 UTC · [original](https://github.com/fxceless/victory-fork/pull/1175) `BradRoland:codex/scripted-pad-slot-zero` → `main` · +164 −15 · 2 files · 1 commits · open In #1167 the game’s profile selector ignored `VICTORY_KEYS` for five minutes with no controller plugged in. A local diagnostic experiment got past the screen by keeping pad 0 connected even between scripted keypresses. On main, a synthetic GameInput client that registers a pad callback receives device 4 in this case and cannot read pad 0. When a Windows diagnostics build has a valid `VICTORY_KEYS` schedule and all hardware pad slots are empty, the existing keyboard stand-in now occupies GameInput slot 0 for the duration, including gaps between keys. It retains the keyboard mappings for buttons, sticks and triggers. Plugging in a physical controller restores that controller’s input, and a real pad 0 takes over the same logical device. Rumble is forwarded only when a physical pad is available for that slot. The script clock starts at the first input sample, so a `0:Enter` press survives a slow initial hardware poll. Empty and invalid schedules use the existing fallback device. The regression drives the parsed key schedule with a synthetic clock and fake source. It checks stable device identity and callbacks, keyboard and pad readings on press and release, plugging and unplugging two different controller slots, and rumble routing. It failed on the original slot-4 enumeration. Reproduce with `cargo test --locked -p victory-hle --features diagnostics scripted_keys_keep_slot_zero -- --nocapture`. The Windows HLE crate passed 101 unit tests plus its integration test with diagnostics. Its ordinary build passed 100 unit tests plus its integration test. The profile screen still needs a title replay on this commit. AI-assisted implementation and testing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:58:55 +00:00
Author
Owner

@⁠Swagi-REDACTED on GitHub · 2026-11-26 08:17 UTC · original

Tested this together with #1027 on the 46bf5351707b1697c04e5d871c30973ebaa3e973 fork baseline, on Windows 11 x64, Ryzen 7 9800X3D (8 logical processors), RTX 3060 12 GB, 16 GB RAM. Game assets remain on an HDD; derived cache/data are on an SSD.

Combination result: with VICTORY_KEYS unset and only a nonempty VICTORY_KEYS_LIVE path, fallback_slot() still returned 4. An isolated-process regression reproduced that (left: 4, right: 0); absent and empty paths retained the existing fallback. The integration now selects slot 0 for a nonempty live path too, and ignores an empty live path in the follower. The additional change and regression are in 0d5b483; the preceding commits preserve the original authors of #1027 and this PR.

Validation on that source tree:

  • cargo test --locked --profile diag -p victory-hle --features diagnostics --lib modules::gameinput:: -- --test-threads=1: 13 passed, 0 failed, 0 ignored, no skips. Includes the live parser/queue tests and this PR's hotplug/device-identity test; subprocess checks are additional executions, not extra top-level tests.
  • cargo test --locked -p victory-hle --lib modules::gameinput:: -- --test-threads=1: 7 passed, 0 failed, 0 ignored, no skips.
  • cargo build --locked --profile diag -p victory --features diagnostics: passed.
  • cargo xtask policy: 220 files OK. No game data or captures are in the branch.

Local title check: A newer retail game, Series X profile, NVIDIA hardware adapter. With the live-only configuration above, appending one Enter:500 line advanced the displayed profile screen into loading. The runtime logged that one line, and the screen transition was observed. The binary was built from the same tree immediately before the final commit; executable SHA-256 CC89A3976827001D2E5EDC3C0457F12B9F839D3DA84F69C32D1DA57F77FAA73D.

Movement, camera control, pause, full prologue completion, and the full post-integration workspace/GPU suites are not yet verified. This is a report of the combined configuration, not a standalone validation of either PR or a performance comparison.

AI use: Codex, GPT-6 (exact serving variant not exposed), investigated the integration, wrote its additional regression/fix, and ran these checks. Human GitHub account owns the fork; original patch authors retain their credit.

**@⁠Swagi-REDACTED** on GitHub · 2026-11-26 08:17 UTC · [original](https://github.com/fxceless/victory-fork/pull/1175#issuecomment-7186419980) Tested this together with #1027 on the `46bf5351707b1697c04e5d871c30973ebaa3e973` fork baseline, on Windows 11 x64, Ryzen 7 9800X3D (8 logical processors), RTX 3060 12 GB, 16 GB RAM. Game assets remain on an HDD; derived cache/data are on an SSD. **Combination result:** with `VICTORY_KEYS` unset and only a nonempty `VICTORY_KEYS_LIVE` path, `fallback_slot()` still returned 4. An isolated-process regression reproduced that (`left: 4`, `right: 0`); absent and empty paths retained the existing fallback. The integration now selects slot 0 for a nonempty live path too, and ignores an empty live path in the follower. The additional change and regression are in [0d5b483](https://github.com/Swagi-REDACTED/victory-fork/commit/0d5b48363233a613f02b544d6c01a63dadce5f86); the preceding commits preserve the original authors of #1027 and this PR. **Validation on that source tree:** - `cargo test --locked --profile diag -p victory-hle --features diagnostics --lib modules::gameinput:: -- --test-threads=1`: **13 passed, 0 failed, 0 ignored**, no skips. Includes the live parser/queue tests and this PR's hotplug/device-identity test; subprocess checks are additional executions, not extra top-level tests. - `cargo test --locked -p victory-hle --lib modules::gameinput:: -- --test-threads=1`: **7 passed, 0 failed, 0 ignored**, no skips. - `cargo build --locked --profile diag -p victory --features diagnostics`: passed. - `cargo xtask policy`: 220 files OK. No game data or captures are in the branch. **Local title check:** **A newer retail game**, Series X profile, NVIDIA hardware adapter. With the live-only configuration above, appending one `Enter:500` line advanced the displayed profile screen into loading. The runtime logged that one line, and the screen transition was observed. The binary was built from the same tree immediately before the final commit; executable SHA-256 `CC89A3976827001D2E5EDC3C0457F12B9F839D3DA84F69C32D1DA57F77FAA73D`. Movement, camera control, pause, full prologue completion, and the full post-integration workspace/GPU suites are **not yet verified**. This is a report of the combined configuration, not a standalone validation of either PR or a performance comparison. **AI use:** Codex, GPT-6 (exact serving variant not exposed), investigated the integration, wrote its additional regression/fix, and ran these checks. Human GitHub account owns the fork; original patch authors retain their credit.
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/1175/head:github-bot/gh-1175'
git switch 'github-bot/gh-1175'

Merge

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