PlayStation 4 Dual Shock Controller Input Mapping with Unity on Windows 10

I finally got around to setting up my Sony PlayStation 4 Pro and I find the DualShock 4 (DS4) interesting as an alternate controller so I plugged it via USB cable to my Windows 10 workstation to check out the button and stick mapping in Unity.  As expected I get yet another set of axis and button mappings and a variation in the return values; other setups return 0 to 1 or -1 to 0, on the DS4 we get -1 to 1.

The notable feature is the way the Triggers (L2 and R2) are handled, they map both to a button and axis to give button press state and an analog value based on trigger pull.  Unlike the Xbox Controller, the DualShock triggers do not share an axis as a convenience option but is easily computed using the assigned axes.  The PS (PlayStation Logo) button along with the touch pad also registers a button click.

Following is the mapping table on the controller, the corresponding joystick axis and the return values. Values are Left to Right or Down to Up.

Left Stick X-Axis

X Axis

-1 to 1

Left Stick Y-Axis

Y Axis

1 to -1

Right Stick X-Axis

3rd Axis

-1 to 1

Right Stick Y-Axis

6th Axis

1 to -1


7th Axis

-1 to 1 (0.64 with multiple buttons)


9th Axis

-1 to 1 (0.64 with multiple buttons)


joystick button 4


joystick button 5

L2 as Button

joystick button 6

L2 as Axis

4th Axis

-1 to 1

R2 as Button

joystick button 7

R2 as Axis

5th Axis

-1 to 1

Left Stick Click

joystick button 10

Right Stick Click

joystick button 11

Touchpad Click

joystick button 13

X Button

joystick button 1

O Button

joystick button 2

Square Button

joystick button 0

Triangle Button

joystick button 3

Share Button

joystick button 8

Option Button

joystick button 9

PS Button

joystick button 12