Skip to content

Commit

Permalink
testevdev: Add test data for Microsoft Xbox Series S|X Controller
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
smcv committed Jun 8, 2023
1 parent 514748d commit 0aedd94
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/testevdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0aedd94

Please sign in to comment.