Browse Source

device: add support for DualShock Gen 2 (PS4) controllers on Windows

Closes #831

Co-authored-by: rdb <[email protected]>
Nathan S 6 years ago
parent
commit
b78f0b0881
1 changed files with 12 additions and 0 deletions
  1. 12 0
      panda/src/device/winRawInputDevice.cxx

+ 12 - 0
panda/src/device/winRawInputDevice.cxx

@@ -69,6 +69,18 @@ static const struct DeviceMapping {
   {0x0955, 0x7214, InputDevice::DeviceClass::gamepad, 0,
     {"face_a", "face_b", 0, "face_x", "face_y", "rshoulder", "lshoulder", "rshoulder", 0, 0, 0, "start", 0, "lstick", "rstick", 0}
   },
+  // Dualshock (PS4)
+  {0x054c, 0x05c4, InputDevice::DeviceClass::gamepad, 0,
+    {"face_x", "face_a", "face_b", "face_y", "lshoulder", "rshoulder", "ltrigger", "rtrigger", "back", "start", "lstick", "rstick", "guide", 0}
+  },
+  // Dualshock 2nd Gen (PS4 Slim)
+  {0x054c, 0x09cc, InputDevice::DeviceClass::gamepad, 0,
+    {"face_x", "face_a", "face_b", "face_y", "lshoulder", "rshoulder", "ltrigger", "rtrigger", "back", "start", "lstick", "rstick", "guide", 0}
+  },
+  // Dualshock 2nd Gen (PS4 wireless adapter)
+  {0x054c, 0x0ba0, InputDevice::DeviceClass::gamepad, 0,
+    {"face_x", "face_a", "face_b", "face_y", "lshoulder", "rshoulder", "ltrigger", "rtrigger", "back", "start", "lstick", "rstick", "guide", 0}
+  },
   {0},
 };