From ff01b43459b8cd9cd24ce6f2a91d86e03f0f7bc9 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[EMAIL REDACTED]>
Date: Thu, 8 Jun 2023 15:48:46 +0100
Subject: [PATCH] testevdev: Add Google Stadia controller
This is a bit unusual because it has a small number of what would
ordinarily be keyboard keys. Thanks to Jeremy Whiting for recording
this.
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
test/testevdev.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/test/testevdev.c b/test/testevdev.c
index 8167b67e79a4..1a19e2c48237 100644
--- a/test/testevdev.c
+++ b/test/testevdev.c
@@ -686,6 +686,37 @@ static const GuessTest guess_tests[] =
/* 0x100 */ ZEROx4, 0xff, 0x03, 0x00, 0x00,
},
},
+ {
+ .name = "Google Stadia Controller rev.A",
+ /* This data is with USB-C, but the same physical device via Bluetooth,
+ * 0005:18d1:9400 v0000, is functionally equivalent */
+ .bus_type = 0x0003,
+ .vendor_id = 0x18d1,
+ .product_id = 0x9400,
+ .version = 0x0100,
+ .expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_KEYBOARD,
+ .ev = { 0x0b },
+ /* XYZ, RZ, gas, brake, hat0 */
+ .abs = { 0x27, 0x06, 0x03 },
+ .keys = {
+ /* 0x00 */ ZEROx8,
+ /* Volume up/down */
+ /* 0x40 */ ZEROx4, 0x00, 0x00, 0x0c, 0x00,
+ /* Media play/pause */
+ /* 0x80 */ ZEROx4, 0x10, 0x00, 0x00, 0x00,
+ /* 0xc0 */ ZEROx8,
+ /* ABXY, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
+ /* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
+ /* 0x140 */ ZEROx8,
+ /* 0x180 */ ZEROx8,
+ /* 0x1c0 */ ZEROx8,
+ /* 0x200 */ ZEROx8,
+ /* 0x240 */ ZEROx8,
+ /* 0x280 */ ZEROx8,
+ /* TRIGGER_HAPPY 1-4 */
+ /* 0x2c0 */ 0x0f, 0x00, 0x00, 0x00, ZEROx4,
+ },
+ },
{
.name = "Wiimote - buttons",
.bus_type = 0x0005,