GameInput: keep the keyboard stand-in for idle pads #3755

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3755 into main
andrewpozdnakov7-jpg commented 2026-11-28 15:20:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T15:20:09Z.


The keyboard stand-in disappears when a host pad supplies its first non-default reading. A resting stick or trigger can produce a small nonzero reading. At initial activation, require a button, a trigger above the XInput threshold, or a stick outside XInput's circular deadzone. An activated pad forwards its original readings until it disconnects. XInput deadzone guidance

The generated-input regression fails on main because the resting pad takes the real slot. With this change the keyboard still drives the stand-in. A diagonal stick movement activates the pad, subsequent small values reach the pad reading, reconnecting at rest brings back the keyboard, and an above-threshold trigger can activate the new connection.

All 11 GameInput tests passed in both ordinary and diagnostic builds. Both strict HLE Clippy configurations and the asset policy passed.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5541637327 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3755). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T15:20:09Z. --- The keyboard stand-in disappears when a host pad supplies its first non-default reading. A resting stick or trigger can produce a small nonzero reading. At initial activation, require a button, a trigger above the XInput threshold, or a stick outside XInput's circular deadzone. An activated pad forwards its original readings until it disconnects. [XInput deadzone guidance](https://learn.microsoft.com/en-us/windows/win32/xinput/getting-started-with-xinput#dead-zone) The generated-input regression fails on main because the resting pad takes the real slot. With this change the keyboard still drives the stand-in. A diagonal stick movement activates the pad, subsequent small values reach the pad reading, reconnecting at rest brings back the keyboard, and an above-threshold trigger can activate the new connection. All 11 GameInput tests passed in both ordinary and diagnostic builds. Both strict HLE Clippy configurations and the asset policy passed. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 15:24:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T15:24:36Z.


Windows CI passed on 08edf43, including both Clippy configurations and the workspace tests. The same generated-input test failed on main, where a resting pad immediately took the real slot. The patch kept the keyboard available during drift and forwarded the physical readings after a deliberate movement. All 11 GameInput tests passed locally in both normal and diagnostic configurations.

The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7241444872 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3755#issuecomment-7241444872). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T15:24:36Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46159321015/job/141022864517) passed on `08edf43`, including both Clippy configurations and the workspace tests. The same generated-input test failed on `main`, where a resting pad immediately took the real slot. The patch kept the keyboard available during drift and forwarded the physical readings after a deliberate movement. All 11 GameInput tests passed locally in both normal and diagnostic configurations. The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
cloph-dsp commented 2026-11-28 15:36:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T15:36:27Z.


Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #3755 at head 08edf4316ebda3e377e344ec0d321ef76d06bb3e, base/parent 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • cargo test --locked -p victory-hle --lib -- modules::gameinput::tests::idle_analog_input_keeps_the_keyboard_stand_in --exact --test-threads=1 --quiet → 1 passed, 0 failed, 152 filtered, exit 0.
  • git grep -F for the test name on the parent returned no match (test is new on this PR); git diff --check HEAD^ HEAD clean (1 file, +87/-3).
  • Used a per-worktree CARGO_TARGET_DIR (never shared) with CARGO_BUILD_JOBS=2.
  • Only the named synthetic test was replayed; full workspace suite and clippy were not run locally.
  • GPU/driver: N/A (CPU-only GameInput test). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7241596813 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3755#issuecomment-7241596813). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T15:36:27Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #3755 at head `08edf4316ebda3e377e344ec0d321ef76d06bb3e`, base/parent `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - `cargo test --locked -p victory-hle --lib -- modules::gameinput::tests::idle_analog_input_keeps_the_keyboard_stand_in --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 152 filtered, exit 0. - `git grep -F` for the test name on the parent returned no match (test is new on this PR); `git diff --check HEAD^ HEAD` clean (1 file, +87/-3). - Used a per-worktree `CARGO_TARGET_DIR` (never shared) with `CARGO_BUILD_JOBS=2`. - Only the named synthetic test was replayed; full workspace suite and clippy were not run locally. - GPU/driver: N/A (CPU-only GameInput test). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
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/3755:upstream-pr/3755'
git switch 'upstream-pr/3755'

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