testevdev: Add test data for Microsoft Xbox Series S|X Controller

Like the Stadia controller, this is unusual because it represents the
Share button as the Record key from a multimedia keyboard (as of Linux
6.2.11 with the xpad driver). Thanks to Jeremy Whiting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2023-06-08 15:51:10 +01:00 committed by Sam Lantinga
parent ff01b43459
commit 8a82e06075
1 changed files with 45 additions and 0 deletions

View File

@ -717,6 +717,51 @@ static const GuessTest guess_tests[] =
/* 0x2c0 */ 0x0f, 0x00, 0x00, 0x00, ZEROx4,
},
},
{
.name = "Microsoft Xbox Series S|X Controller (model 1914) via USB",
/* Physically the same device as 0003:045e:0b13 v0515 below,
* but some functionality is mapped differently */
.bus_type = 0x0003,
.vendor_id = 0x045e,
.product_id = 0x0b12,
.version = 0x050f,
.expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_KEYBOARD,
.ev = { 0x0b },
/* X, Y, Z, RX, RY, RZ, hat 0 */
.abs = { 0x3f, 0x00, 0x03 },
.keys = {
/* 0x00 */ ZEROx8,
/* 0x40 */ ZEROx8,
/* Record */
/* 0x80 */ ZEROx4, 0x80, 0x00, 0x00, 0x00,
/* 0xc0 */ ZEROx8,
/* ABXY, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
},
},
{
.name = "Microsoft Xbox Series S|X Controller (model 1914) via Bluetooth",
/* Physically the same device as 0003:045e:0b12 v050f above,
* but some functionality is mapped differently */
.bus_type = 0x0003,
.vendor_id = 0x045e,
.product_id = 0x0b13,
.version = 0x0515,
.expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_KEYBOARD,
.ev = { 0x0b },
/* XYZ, RZ, gas, brake, hat0 */
.abs = { 0x27, 0x06, 0x03 },
.keys = {
/* 0x00 */ ZEROx8,
/* 0x40 */ ZEROx8,
/* Record */
/* 0x80 */ ZEROx4, 0x80, 0x00, 0x00, 0x00,
/* 0xc0 */ ZEROx8,
/* ABC, XYZ, TL, TR, TL2, TR2, select, start, mode, thumbl,
* thumbr */
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x7f,
},
},
{
.name = "Wiimote - buttons",
.bus_type = 0x0005,