Skip to content

Commit

Permalink
testevdev: Add test data for a DualSense (PS5) gamepad
Browse files Browse the repository at this point in the history
Also make details of PS4 gamepads (which are very similar from an evdev
point of view) more specific.

Thanks to Sam Lantinga and Jeremy Whiting for recording these.

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv committed Jun 8, 2023
1 parent d61a84b commit 6ac1c4a
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion test/testevdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,52 @@ static const GuessTest guess_tests[] =
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
},
},
{
.name = "DualSense (PS5) - gamepad",
.bus_type = 0x0003,
.vendor_id = 0x054c,
.product_id = 0x0ce6,
.version = 0x111,
.expected = SDL_UDEV_DEVICE_JOYSTICK,
/* SYN, KEY, ABS */
.ev = { 0x0b },
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
.abs = { 0x3f, 0x00, 0x03 },
.keys = {
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
/* ABC, XYZ, TL, TR, TL2, TR2, select, start, mode, thumbl,
* thumbr; note that C and Z don't physically exist */
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x7f,
},
},
{
.name = "DualSense (PS5) v8111 - gamepad",
/* Same physical device via Bluetooth is 0005:054c:0ce6 v8100,
* but otherwise equivalent */
.bus_type = 0x0003,
.vendor_id = 0x054c,
.product_id = 0x0ce6,
.version = 0x8111,
.expected = SDL_UDEV_DEVICE_JOYSTICK,
/* SYN, KEY, ABS */
.ev = { 0x0b },
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
.abs = { 0x3f, 0x00, 0x03 },
.keys = {
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
* THUMBL, THUMBR */
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7f,
},
},
{
.name = "DualShock 4 - gamepad",
/* Same physical device via Bluetooth is 0005:054c:09cc v8100,
* but otherwise equivalent */
.bus_type = 0x0003,
.vendor_id = 0x054c,
.product_id = 0x09cc,
.version = 0x8111,
.expected = SDL_UDEV_DEVICE_JOYSTICK,
/* SYN, KEY, ABS, MSC, FF */
/* Some versions only have 0x0b, SYN, KEY, ABS, like the
Expand All @@ -178,7 +219,7 @@ static const GuessTest guess_tests[] =
},
},
{
.name = "DualShock 4 - gamepad via Bluetooth",
.name = "DualShock 4 - gamepad via Bluetooth (unknown version)",
.bus_type = 0x0005,
.vendor_id = 0x054c,
.product_id = 0x09cc,
Expand All @@ -196,9 +237,15 @@ static const GuessTest guess_tests[] =
},
{
.name = "DualShock 4 - touchpad",
/* Same physical device via Bluetooth is 0005:054c:09cc v8100 and is
* functionally equivalent. */
/* DualSense (PS5), 0003:054c:0ce6 v8111, is functionally equivalent.
* Same physical device via Bluetooth is 0005:054c:0ce6 v8100 and also
* functionally equivalent. */
.bus_type = 0x0003,
.vendor_id = 0x054c,
.product_id = 0x09cc,
.version = 0x8111,
.expected = SDL_UDEV_DEVICE_TOUCHPAD,
/* SYN, KEY, ABS */
.ev = { 0x0b },
Expand All @@ -216,9 +263,15 @@ static const GuessTest guess_tests[] =
},
{
.name = "DualShock 4 - accelerometer",
/* Same physical device via Bluetooth is 0005:054c:09cc v8100 and is
* functionally equivalent. */
/* DualSense (PS5), 0003:054c:0ce6 v8111, is functionally equivalent.
* Same physical device via Bluetooth is 0005:054c:0ce6 v8100 and also
* functionally equivalent. */
.bus_type = 0x0003,
.vendor_id = 0x054c,
.product_id = 0x09cc,
.version = 0x8111,
.expected = SDL_UDEV_DEVICE_ACCELEROMETER,
/* SYN, ABS, MSC */
.ev = { 0x19 },
Expand Down

0 comments on commit 6ac1c4a

Please sign in to comment.