Input: read PlayStation and generic HID pads that XInput does not list #68
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/68"
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?
Imported from fxceless/victory-fork. Originally posted by marquezinii on 2026-11-24T21:08:41Z.
Only XInput pads reach the title today, so a DualSense or DualShock 4 (or any pad without an XInput driver) does nothing unless something like Steam Input turns it into an XInput pad. This reads those pads over HID and puts them in the slots XInput leaves empty.
What is read
hid-playstationuses). On Bluetooth the feature report that switches the pad to full reports is read first; the short report is understood as well. Cross/Circle/Square/Triangle go to A/B/X/Y, Options to Menu, Create and the touchpad click to View. Rumble goes through their output reports (Bluetooth ones with the CRC); the light bar is left alone.VICTORY_PAD_BUTTONStakes other button numbers for pads that differ.How it fits
gameinput/hid.rs;Hostingameinput.rsasks XInput first, then the HID pads. An XInput pad keeps its slot; a HID pad sitting in a slot XInput takes moves to a free one.rumblereaches the HID pad in that slot too.IG_in the path) are skipped, so Xbox pads are not read twice.windows-sysfeatures (HID, SetupAPI) andWin32_System_IO.Cargo.lockis unchanged.Tested
connected_hid_padstest, read both ways: as a DualSense, and forced through the generic path (a local change, not in this PR). Both times every one of the 14 buttons came through on its own bit, both triggers went 0 to 1 and both sticks -1 to 1 on each axis. The rumble ran for the second the test asks for.cargo clippy --workspace --all-targets -- -D warnings(default and--all-features),cargo test -p victory-hle(105 passed) andcargo xtask policypass.Not tested: Bluetooth (no adapter here), a DualShock 4, a real generic pad other than the DualSense, and in the title itself (I don't have the files on this machine). If someone can try one of those,
cargo test -p victory-hle connected_hid_pads -- --ignored --nocaptureprints every change of state.Upstream has similar open work (Marvisak/VIctory#150 and #1517 for the DualSense over HID, #312 for an SDL3 backend). This one stays without new dependencies and also covers the DualShock 4 and generic pads.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.