Skip to content

Windows: Add basic native support for DualShock / DualSense - #20580

Merged
hrydgard merged 4 commits into
masterfrom
ps-controller-support
Jul 3, 2025
Merged

hrydgard merged 4 commits into
masterfrom
ps-controller-support

Conversation

@hrydgard

@hrydgard hrydgard commented Jun 28, 2025 •

Copy link
Copy Markdown
Owner

Uses direct HID input access, since DirectInput is very broken with these.

This could later be extended with stuff like touchpad input, though I have no idea what to use that for. Accelerometer for DualSense might be more interesting! Anyway, here are the basics.

I'm considering adding another device category like we already have for x360 (XInput) controllers. Although for now I just mapped it to replace DInput mappings directly... Not sure what is best?

DirectInput will now skip over any DualShock/sense controllers, and instead let the HID API take over.

Anyway, I've only tested this on DualShock over USB so far, DualSense testers needed!

Fixes #20473

@hrydgard hrydgard added this to the v1.20 milestone Jun 28, 2025
@hrydgard hrydgard added the Input/Controller Input and controller issues label Jun 28, 2025
@hrydgard hrydgard changed the title Windows: Add native support for DualShock / DualSense Windows: Add basic native support for DualShock / DualSense Jun 28, 2025
@hrydgard

Copy link
Copy Markdown
Owner Author

Hm, while this works great over USB I was unable to get this to work over Bluetooth. Apparently it goes into low-energy Bluetooth "GATT" mode, where you can't read direclty from the device using ReadFile, instead Windows handles input internally.

So might have to add an option to use DirectInput (which works unless you're running Steam), or simply tell the user to switch to USB... Ugh. Needs more digging.

@bslenul

bslenul commented Jun 29, 2025

Copy link
Copy Markdown
Contributor

Briefly tested with a DualSense, no success wireless and it's acting weird with USB: if I try to edit or add a binding it instantly binds itself to "pad1.Home" and after that my mouse doesn't work properly anymore in menus for some reason 🤔

@hrydgard

hrydgard commented Jun 29, 2025 •

Copy link
Copy Markdown
Owner Author

Uuh, that's not good :( clearly it thinks HOME is continuously pressed, which is bad. you may have to kill off PSP/SYSTEM/controls.ini (or edit it appropriately) to get back to a normal state @bslenul

I've ordered a DualSense, I'll figure this out.

@hrydgard
hrydgard force-pushed the ps-controller-support branch from 4abee72 to ade9536 Compare July 3, 2025 09:09
@hrydgard
hrydgard force-pushed the ps-controller-support branch from ade9536 to fc09669 Compare July 3, 2025 09:11
@hrydgard

hrydgard commented Jul 3, 2025

Copy link
Copy Markdown
Owner Author

Alright, I've got a DualSense now and thanks to looking at DS4Windows for a bit, I managed to get it working correctly via USB, with full access (I can access all features if needed but for now we only look at buttons, sticks and triggers).

I also removed Bluetooth support for now since I couldn't get it working properly. I'll get this in as-is, then we can add more features later.

@hrydgard
hrydgard merged commit 1ce6082 into master Jul 3, 2025
@hrydgard
hrydgard deleted the ps-controller-support branch July 3, 2025 09:46
@oltolm

oltolm commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

I get this error

In file included from C:/src/ppsspp/Windows/main.cpp:71:
C:/src/ppsspp/Windows/HidInputDevice.h:13:6: error: ISO C++ forbids forward references to 'enum' types
   13 | enum InputDeviceID;
      |      ^
C:/src/ppsspp/Windows/main.cpp:449:10: warning: enumeration value 'UI_STATE_CHANGED' not handled in switch [-Wswitch]
  449 |         switch (notification) {
      |                 ^~~~~~~~~~~~
1 warning and 1 error generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input/Controller Input and controller issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native support for PS4/PS5 controllers on Windows

3 participants