HLE: write a neutral GameInput state for non-gamepad readings #369

Open
avt0m4t48 wants to merge 1 commit from upstream-pr/369 into main
avt0m4t48 commented 2026-11-25 00:00:21 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T00:00:21Z.


GameInput specifies that a reading of the wrong kind returns false and writes the default at-rest gamepad state. Victory returned false with the caller's previous state still in the output. Write a neutral state for a keyboard reading so a reused buffer cannot retain old button, trigger, or stick values. Microsoft API contract

The existing keyboard/stand-in test now passes the same state buffer to both reading kinds through their interface vtables. It failed on main and passed with the fix. All five fake-source module tests passed in the Linux harness. A separate vtable probe filled and then cleared all seven fields. The Windows MSVC HLE and GPU test targets type-checked with warnings denied. Native Windows execution and game behavior were outside these checks.

AI-assisted using Codex.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593942494 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/369). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T00:00:21Z. --- GameInput specifies that a reading of the wrong kind returns `false` and writes the default at-rest gamepad state. Victory returned `false` with the caller's previous state still in the output. Write a neutral state for a keyboard reading so a reused buffer cannot retain old button, trigger, or stick values. [Microsoft API contract](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getgamepadstate?view=gdk-2604#remarks) The existing keyboard/stand-in test now passes the same state buffer to both reading kinds through their interface vtables. It failed on main and passed with the fix. All five fake-source module tests passed in the Linux harness. A separate vtable probe filled and then cleared all seven fields. The Windows MSVC HLE and GPU test targets type-checked with warnings denied. Native Windows execution and game behavior were outside these checks. AI-assisted using Codex.
avt0m4t48 commented 2026-11-25 15:08:33 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T14:43:19Z.


All six GameInput module tests passed on native Windows at 8982484. The keyboard and stand-in pad test reuses the same gamepad output buffer through both vtables and verifies that the keyboard reading returns false with a neutral output. These tests use a fake input source and do not require a physical controller.

Exact-head Windows run

AI-assisted using Codex.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7165712006 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/369#issuecomment-7165712006). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T14:43:19Z. --- All six GameInput module tests passed on native Windows at `8982484`. The keyboard and stand-in pad test reuses the same gamepad output buffer through both vtables and verifies that the keyboard reading returns false with a neutral output. These tests use a fake input source and do not require a physical controller. [Exact-head Windows run](https://github.com/avt0m4t48/victory-fork/actions/runs/45636256267) AI-assisted using Codex.
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/369:upstream-pr/369'
git switch 'upstream-pr/369'

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