testevdev: Add test data for a DualSense (PS5) gamepad

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 <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2023-06-08 15:13:38 +01:00 committed by Sam Lantinga
parent 2fb1df1551
commit f4a53e78c8
1 changed files with 54 additions and 1 deletions

View File

@ -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
@ -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,
@ -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 },
@ -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 },