GameInput: a DualShock 4 or DualSense is the gamepad without XInput #552
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!552
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/552/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?
@CIS-C0 on GitHub · 2026-11-24 01:42 UTC · original
CIS-C0:gameinput-playstation-pads→main· +220 −3 · 4 files · 1 commits · merged 2026-11-25 01:07 UTCA player with a PlayStation controller has no gamepad in XCL: GameInput reads XInput only, and Windows gives a DualShock 4 or DualSense to XInput only through extra software (Steam Input, DS4Windows). This reads them as HID devices and uses one when no XInput controller answers.
I searched open and closed issues and PRs for "dualsense", "dualshock", "playstation controller", "PS4 controller", "PS5 controller" and "controller" first: nothing covers it.
What is in it
crates/xcl/src/hle/playstation.rs: a thread finds the first HID interface of a Sony controller (vendor 054C: DualShock 4 05C4 / 09CC / USB adaptor 0BA0, DualSense 0CE6, DualSense Edge 0DF2;CM_Get_Device_Interface_ListW, no new crate features), reads its input report 0x01 and keeps the latest state; it looks again every second while none is connected or after one is unplugged. Cross / Circle / Square / Triangle are A / B / X / Y, Options Menu, Share / Create View, L1 / R1 the shoulders, L3 / R3 the stick clicks, the hat the D-pad, L2 / R2 the triggers. A DualShock 4 over Bluetooth sends the same first bytes as over USB; a DualSense over Bluetooth is left out (its reports are laid out differently). No rumble or light bar.XCL_PLAYSTATION_PAD=0turns it off. One line when one is read, one when it is unplugged.crates/xcl/src/hle/gameinput.rs:polluses it whenxinput_padhas no controller (xinput_pad().or_else(playstation::pad)), so a controller that is also on XInput (Steam Input) is read once, as before.README.md: the Input row and Controls.playstation_reports_read_as_a_gamepad(idle and pressed reports of both layouts give the same states; other report ids and short reports are not read) andplaystation_controllers_are_known_by_their_hid_path(USB and Bluetooth paths, upper case, a DualSense over Bluetooth and an Xbox controller left out).Tested
cargo build --workspacethencargo test --workspace -- --test-threads=4on0db1c5a(debug): 682 passed, 0 failed, 41 ignored (lib 642 / 0 / 21).gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).GameInput: a DualShock 4 is read as the title's gamepad when no XInput controller answers, and every one of the 14 GameInput buttons (0x1 … 0x2000) arrived in the title as it was pressed (gamepad buttons … pressed for the first time), and the title went on from its first screen. Idle, the sticks read 0 / -0.03 / -0.02 / 0.Regression run
Standard run, no input, main and this PR's head one after the other:
main:
this PR's head:
Not tested
AI use
@futurepro62 on GitHub · 2026-11-24 03:47 UTC · original
Tested exact head
0db1c5a(on its base508a0c7).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 682 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Not tested
scripts/smoke.ps1(no title on this machine), AMD, a release build.AI use
@MesshM on GitHub · 2026-11-24 04:21 UTC · original
Test run of
0db1c5a1e0573655de694698d2e14f1849e7ae16on AMD RDNA4. I merged it onto currentmainf4ce27clocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 703 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 662 passed, 0 failed, 21 ignoredSKIPPED;playstation_controllers_are_known_by_their_hid_pathandplaystation_reports_read_as_a_gamepadpass (no Sony controller attached here, so the reader itself did not run).Review: The reader only takes a Sony HID interface (VID 054C, USB or Bluetooth path) and only when no XInput controller answers, so an Xbox controller keeps priority; Bluetooth DualSense reports are left out on purpose. I found nothing to change.
Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175