[Tutorial] UE4 using Dualshock4 controller (via USB, PS4 DS4 Gamepad)

Thanks so much for this tutorial! I’m using UE 4.25.3 and Windows RawInput 1.0. I got this working with slightly different values than the original post, and I think it’s because either my version of UE or RawInput is newer than when this was originally posted.

In my Edit > Project Settings > RawInput, there’s a option for each axis called “Gamepad Stick” which makes things very easy. Also my ProductID is 0x09CC (the documentation for RawInput Plugin shows how to find this).

Here’s all my settings under Edit > Project Setings > RawInput in case it helps someone else. I’ve also included what each axis and button maps to for me. For me the Dpad V & Dpad H are both on Axis 5 with nothing on Axis 6.

Vendor ID: 0x054C
ProductID: 0x09CC
Axis[0]:USB Axis 1 - RStick V Inverted: Yes
Gamepad Stick: Yes
Offset: 0.0

Axis[1]:USB Axis 2 - RStick H Inverted: No
Gamepad Stick: Yes
Offset: 0.0

Axis[2]:USB Axis 3 - LStick V Inverted: Yes
Gamepad Stick: Yes
Offset: 0.0

Axis[3]:USB Axis 4 - LStick H Inverted: No
Gamepad Stick: Yes
Offset: 0.0

Axis[4]:USB Axis 5 - Dpad V & H Inverted: No
Gamepad Stick: No
Offset: 0.0

Axis[5]:USB Axis 6 - doesn’t do anything Maybe it’s supposed to be the touchpad area?

Axis[6]:USB Axis 7 - R2 trigger axis (also Button 8) Inverted: No
Gamepad Stick: No
Offset: 0.0

Axis[7]:USB Axis 8 - L2 trigger axis (also Button 7) Inverted: No
Gamepad Stick: No
Offset: 0.0

[HR][/HR]
Button[0]: USB Button 1 - Square
Button[1]: USB Button 2 - X
Button[2]: USB Button 3 - O
Button[3]: USB Button 4 - Triangle
Button[4]: USB Button 5 - L1
Button[5]: USB Button 6 - R1
Button[6]: USB Button 7 - L2 trigger (also Axis 8)
Button[7]: USB Button 8 - R2 trigger (also Axis 7)
Button[8]: USB Button 9 - Share
Button[9]: USB Button 10 - Options
Button[10]: USB Button 11 - L3
Button[11]: USB Button 12 - R3
Button[12]: USB Button 13 - PS
Button[13]: USB Button 14 - Touchpad Click
[HR][/HR]
One thing that was really helpful to figure the axis values and mapping was to open the game console (press the [FONT=Lucida Sans Unicode]` (backtick) key) and type [FONT=Lucida Sans Unicode]showdebug input

2 Likes