gameinput: DualShock 4 pads read from HID beside XInput #210

Closed
YOGESH9139 wants to merge 1 commit from upstream-pr/210 into main
YOGESH9139 commented 2026-11-26 11:45:01 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by YOGESH9139 on 2026-11-26T11:45:01Z.


Split out of #134, as asked: only the DualShock 4 part.

What it does. DualShock 4 pads (Sony 054C: 05C4, 09CC, 0BA0, 0BA1), and pads that report themselves as one, are read from HID beside XInput, so they work without DS4Windows or Steam Input. Found with a cheap pad that shows up as a DS4 and gave the title no input at all.

  • New crates/victory-hle/src/modules/gameinput/dualshock.rs: SetupDi enumeration of HID devices, one reader thread per pad (blocking ReadFile), a rescan every 2 s for pads plugged in later. USB report 0x01 and Bluetooth report 0x11 are both parsed.
  • Mapping: cross→A, circle→B, square→X, triangle→Y, options→Menu, share/touchpad→View, the hat to the d-pad, sticks scaled with Y inverted, triggers analog.
  • gameinput.rs: a slot's state is XInput merged with the nth DS4, so an XInput pad in the same slot still works.
  • VICTORY_DUALSHOCK=0 turns it off.
  • Cargo.toml: two windows-sys features (Win32_Devices_DeviceAndDriverInstallation, Win32_Devices_HumanInterfaceDevice).

7 unit tests for the report parser. Rebased on 0dec5dc; cargo check and the tests pass. Tested in the title's menus and in the world on Windows 11.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6625942306 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/210). Originally posted by [YOGESH9139](https://github.com/YOGESH9139) on 2026-11-26T11:45:01Z. --- Split out of #134, as asked: only the DualShock 4 part. **What it does.** DualShock 4 pads (Sony 054C: 05C4, 09CC, 0BA0, 0BA1), and pads that report themselves as one, are read from HID beside XInput, so they work without DS4Windows or Steam Input. Found with a cheap pad that shows up as a DS4 and gave the title no input at all. - New `crates/victory-hle/src/modules/gameinput/dualshock.rs`: SetupDi enumeration of HID devices, one reader thread per pad (blocking `ReadFile`), a rescan every 2 s for pads plugged in later. USB report `0x01` and Bluetooth report `0x11` are both parsed. - Mapping: cross→A, circle→B, square→X, triangle→Y, options→Menu, share/touchpad→View, the hat to the d-pad, sticks scaled with Y inverted, triggers analog. - `gameinput.rs`: a slot's state is XInput merged with the nth DS4, so an XInput pad in the same slot still works. - `VICTORY_DUALSHOCK=0` turns it off. - `Cargo.toml`: two `windows-sys` features (`Win32_Devices_DeviceAndDriverInstallation`, `Win32_Devices_HumanInterfaceDevice`). 7 unit tests for the report parser. Rebased on 0dec5dc; `cargo check` and the tests pass. Tested in the title's menus and in the world on Windows 11. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
YOGESH9139 commented 2026-11-26 12:51:40 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by YOGESH9139 on 2026-11-26T12:51:40Z.


Closing: I'm stopping this work for now and taking the fork down. Thanks for the reviews.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7192556510 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/210#issuecomment-7192556510). Originally posted by [YOGESH9139](https://github.com/YOGESH9139) on 2026-11-26T12:51:40Z. --- Closing: I'm stopping this work for now and taking the fork down. Thanks for the reviews.

Pull request closed

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
avatarmanz/VIctory-7900XTX!210
No description provided.