From c13e511844c870d8bae8816ca6c07c7cd8c12a0e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 13 Jun 2023 17:48:50 +0100 Subject: [PATCH] testevdev: Try to correct Wii devices guessed from kernel source The comments here disagreed with the actual bytes. According to https://elixir.bootlin.com/linux/v6.3.7/source/drivers/hid/hid-wiimote-modules.c, the Balance Board reports BTN_A and ABS_HAT0X, HAT0Y, HAT1X and HAT1Y. This means the comments here were correct, but the .abs bits shown were in the wrong byte. Matching the Wii U Pro Controller against the same kernel source, it appears to be correct: it's the same representation as a PS3 gamepad, except that it lacks the Z and RZ axes for analogue triggers. Signed-off-by: Simon McVittie --- test/testevdev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/testevdev.c b/test/testevdev.c index 61052f1300..746d0af495 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -1073,22 +1073,24 @@ static const GuessTest guess_tests[] = }, }, { - /* Flags guessed from kernel source code */ + /* Flags guessed from kernel source code, not confirmed with real + * hardware */ .name = "Wiimote - Balance Board", /* TODO: Should this be JOYSTICK? */ .expected = SDL_UDEV_DEVICE_UNKNOWN, /* SYN, KEY, ABS */ .ev = { 0x0b }, /* Hat 0-1 */ - .abs = { 0x00, 0x0f }, + .abs = { 0x00, 0x00, 0x0f }, .keys = { /* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8, - /* A */ + /* BTN_A */ /* 0x100 */ ZEROx4, 0x00, 0x00, 0x01, 0x00, }, }, { - /* Flags guessed from kernel source code */ + /* Flags guessed from kernel source code, not confirmed with real + * hardware */ .name = "Wiimote - Wii U Pro Controller", .expected = SDL_UDEV_DEVICE_JOYSTICK, /* SYN, KEY, ABS */