runtime: report the GameInput virtual pad as GameInputFamilyXboxOne #2539
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2539
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2539/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Asimmimx on GitHub · 2026-11-25 20:18 UTC · original
Asimmimx:runtime/gameinput-xbox-one-family→main· +17 −1 · 2 files · 2 commits · merged 2026-11-25 20:32 UTCSummary
The virtual gamepad's
GameInputDeviceInfonow carriesdeviceFamily = 1(GameInputFamilyXboxOne) instead of 2 (GameInputFamilyXbox360). This matches its vendor/product045E:0B12, a GIP device, and the existing "family: Xbox One" comment. The keyboard device info is unchanged.Fixes #2538
Tests
startup_gameinput_contracts_checknow reads the gamepad's device info throughFindDeviceFromObjectand expects vendor045E, product0B12anddeviceFamily1.Windows 11 26300, dev preset:
6 of 6 passed (
keys,history,script_long,script_entries,contracts_check,script_syntax).Fail-first
With
gameinput.cppreverted and the new check kept:Open
Hid(3) orI8042(4). Left as is.sample(), a full XInput deflection of -32768 converts to -1.0000305, just outside GameInput's documented [-1, 1] range. That is a separate one-line follow-up.AI-assisted (Claude Code).
@ChazY11 on GitHub · 2026-11-25 20:23 UTC · original
Built and run here: 6/6 pass; the family value this PR changes is caught, and the two sibling fields in the same literal are not
Reproduction notes, because I got both wrong before the run above:
Not Rununtilstartup_stub_gameinputandstartup_gameinput_scriptare built. Thetarget is
startup_gameinput_script— there is nostartup_gameinput_script_long/_entriestarget; those aremodes (
GameInput.dll long,GameInput.dll entries) of the one executable.ctest -N -Vprints their command before that as"D:/…/GameInput.dll" "long", which reads as a broken commandbut is only the unresolved first element.
Three mutations of the descriptor tail
family_xbox_one1 → 2 (Xbox360)0xF→0x0kind_gamepad | kind_controller_bits→kind_gamepadThe caught one is the whole point of the change, so the rename to a named constant did bring an assertion with it: the
fixture must be reading the family out of the descriptor, not just checking that a device enumerates.
The two survivors are the other two fields of the same array
0xFis the rumble capability mask andkind_controller_bits(0xE) decides which kindswants_gamepad()accepts:Dropping the controller bits leaves
kind_gamepad(0x40000) set, sowants_gamepadstill returns true — the change isinvisible to anything that only asks that question. It would show up in a title that filters on the controller sub-kind
specifically, and in a rumble query for the
0xFbyte.I am not claiming either is wrong; the descriptor looks right. The point is that this PR touches a four-word literal and
only one of the four words is now constrained. Two one-line assertions — the kind word equals
kind_gamepad | kind_controller_bits, and the rumble byte equals0xF— would fix that, and they belong in the samecontracts check that already reads the family.
Environment
Windows 11 build 26300.9974; targets
startup_stub_gameinput,startup_gameinput_keys,startup_gameinput_history,startup_gameinput_script,startup_gameinput_script_syntax,startup_gameinput_contracts_checkbuilt individually.Each mutation was rebuilt and re-run, then reverted and rebuilt; final state 6/6 green.
AI-assisted.
@tedin7 on GitHub · 2026-11-25 20:27 UTC · original · reviewed
Review of head
8b16598e(comment only).Looks sound. The gamepad
GameInputDeviceInfofamily becomes 1 (GameInputFamilyXboxOne), matching the 045E:0B12 GIP ids; the enum values in the new comment (Virtual -1, XboxOne 1, Xbox360 2, Hid 3, I8042 4) are consistent with the public GameInput header. The keyboard info is untouched. The new check reads vendor, product and family at the documented offsets (+4, +6, +0x60) throughFindDeviceFromObject, so it guards the caller-visible value. The PR makes no startup claim and measures no title behaviour, so no game verification is implied.Commands run locally on a worktree of the head:
git diff --check origin/main...HEAD-> cleanpython3 tests/docs_links_check.py-> passedpython3 tests/bidi_controls_check.py-> passedAI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 20:31 UTC · original
Win2025 WARP receipt for head
34a582acafter updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
34a582accbb57c307bcea8c4ebec7270e54066e2:--preset dev):ctest --preset dev -R '^startup_gameinput' --parallel 2 --no-tests=error --output-on-failure: 6/6 passed (includesstartup_gameinput_contracts_check)/O2(--preset release): same command: 6/6 passedAI-assisted; commands listed were executed locally.