DualShock 4 and Switch Pro Controller read straight from HID, like th… #462

Open
github-bot wants to merge 1 commit from github-bot/gh-462 into main AGit
Owner

@⁠Togicx on GitHub · 2026-11-27 22:55 UTC · original
Togicx:feat/dualshock4-switch-pro → main · +859 −63 · 6 files · 1 commits · open

…e DualSense

PlayStation 4 pads (DualShock 4, both models, and Sony's wireless adapter) and the Nintendo Switch Pro Controller are now read over USB and Bluetooth without Steam Input or DS4Windows, through the DualSense's HID path: the same scan thread, a reader thread per pad, the same slots behind XInput and the same switch (VICTORY_DUALSENSE).

DualShock 4: its three button bytes are the DualSense's; only where the sticks, triggers and buttons sit differs (USB 0x01, Bluetooth 0x11 two bytes further in, the short Bluetooth 0x01). Full reports are asked for with feature report 0x02 over USB and 0x05 over Bluetooth. Its address, so a pad on cable and Bluetooth at once is opened once, comes from feature report 0x12 over USB and from the HID serial number Windows fills with it over Bluetooth.

Switch Pro Controller (gameinput/switch_pro.rs): over USB the handshake that makes it talk HID (0x80: status, handshake, high speed, handshake, HID only); then its address, the stick calibration in its flash (factory, user calibration where there is one), the first player light and full reports (0x30). A pad already open over Bluetooth is left alone before the USB handshake would take it from there. Face buttons by where they sit, as on an Xbox pad; VICTORY_SWITCH_LABELS=1 by their letters. ZL and ZR are buttons.

Tests with built reports for both pads, their addresses and the Switch calibration; live_pads, an ignored test, prints what real pads read as without the game. README: a Controllers section.

Tested on Windows 11 with a DualShock 4 (second model) and a Switch Pro Controller, each over USB and Bluetooth: live_pads (every button, sticks to +-1.0 with the calibration, analog triggers on the DualShock 4, cable plugged in while on Bluetooth opened once), and in the game, pads plugged and unplugged and switched within one session.

**@⁠Togicx** on GitHub · 2026-11-27 22:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/462) `Togicx:feat/dualshock4-switch-pro` → `main` · +859 −63 · 6 files · 1 commits · open …e DualSense PlayStation 4 pads (DualShock 4, both models, and Sony's wireless adapter) and the Nintendo Switch Pro Controller are now read over USB and Bluetooth without Steam Input or DS4Windows, through the DualSense's HID path: the same scan thread, a reader thread per pad, the same slots behind XInput and the same switch (VICTORY_DUALSENSE). DualShock 4: its three button bytes are the DualSense's; only where the sticks, triggers and buttons sit differs (USB 0x01, Bluetooth 0x11 two bytes further in, the short Bluetooth 0x01). Full reports are asked for with feature report 0x02 over USB and 0x05 over Bluetooth. Its address, so a pad on cable and Bluetooth at once is opened once, comes from feature report 0x12 over USB and from the HID serial number Windows fills with it over Bluetooth. Switch Pro Controller (gameinput/switch_pro.rs): over USB the handshake that makes it talk HID (0x80: status, handshake, high speed, handshake, HID only); then its address, the stick calibration in its flash (factory, user calibration where there is one), the first player light and full reports (0x30). A pad already open over Bluetooth is left alone before the USB handshake would take it from there. Face buttons by where they sit, as on an Xbox pad; VICTORY_SWITCH_LABELS=1 by their letters. ZL and ZR are buttons. Tests with built reports for both pads, their addresses and the Switch calibration; `live_pads`, an ignored test, prints what real pads read as without the game. README: a Controllers section. Tested on Windows 11 with a DualShock 4 (second model) and a Switch Pro Controller, each over USB and Bluetooth: live_pads (every button, sticks to +-1.0 with the calibration, analog triggers on the DualShock 4, cable plugged in while on Bluetooth opened once), and in the game, pads plugged and unplugged and switched within one session.
PlayStation 4 pads (DualShock 4, both models, and Sony's wireless adapter)
and the Nintendo Switch Pro Controller are now read over USB and Bluetooth
without Steam Input or DS4Windows, through the DualSense's HID path: the
same scan thread, a reader thread per pad, the same slots behind XInput
and the same switch (VICTORY_DUALSENSE).

DualShock 4: its three button bytes are the DualSense's; only where the
sticks, triggers and buttons sit differs (USB 0x01, Bluetooth 0x11 two
bytes further in, the short Bluetooth 0x01). Full reports are asked for
with feature report 0x02 over USB and 0x05 over Bluetooth. Its address, so
a pad on cable and Bluetooth at once is opened once, comes from feature
report 0x12 over USB and from the HID serial number Windows fills with it
over Bluetooth.

Switch Pro Controller (gameinput/switch_pro.rs): over USB the handshake
that makes it talk HID (0x80: status, handshake, high speed, handshake,
HID only); then its address, the stick calibration in its flash (factory,
user calibration where there is one), the first player light and full
reports (0x30). A pad already open over Bluetooth is left alone before
the USB handshake would take it from there. Face buttons by where they
sit, as on an Xbox pad; VICTORY_SWITCH_LABELS=1 by their letters. ZL and
ZR are buttons.

Tests with built reports for both pads, their addresses and the Switch
calibration; `live_pads`, an ignored test, prints what real pads read as
without the game. README: a Controllers section.

Tested on Windows 11 with a DualShock 4 (second model) and a Switch Pro
Controller, each over USB and Bluetooth: live_pads (every button, sticks
to +-1.0 with the calibration, analog triggers on the DualShock 4, cable
plugged in while on Bluetooth opened once), and in the game, pads plugged
and unplugged and switched within one session.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:00:11 +00:00
This pull request has changes conflicting with the target branch.
  • Cargo.lock
  • crates/victory-hle/Cargo.toml
  • crates/victory-hle/src/modules/gameinput.rs
  • crates/victory-hle/src/modules/gameinput/dualsense.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/462/head:github-bot/gh-462'
git switch 'github-bot/gh-462'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-462'
git switch 'github-bot/gh-462'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-462'
git switch 'github-bot/gh-462'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-462'
git switch 'main'
git merge --squash 'github-bot/gh-462'
git switch 'main'
git merge --ff-only 'github-bot/gh-462'
git switch 'main'
git merge 'github-bot/gh-462'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!462
No description provided.