2
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
3
Copyright (C) 2020-2022 Collabora Ltd.
5
This software is provided 'as-is', without any express or implied
6
warranty. In no event will the authors be held liable for any damages
7
arising from the use of this software.
9
Permission is granted to anyone to use this software for any purpose,
10
including commercial applications, and to alter it and redistribute it
14
/* Hack #1: avoid inclusion of SDL_main.h by SDL_internal.h */
17
/* Hack #2: avoid dynapi renaming (must be done before #include <SDL3/SDL.h>) */
18
#include "../src/dynapi/SDL_dynapi.h"
22
#define SDL_DYNAMIC_API 0
24
#ifndef NO_BUILD_CONFIG
25
#include "../src/SDL_internal.h"
28
/* Hack #3: undo Hack #1 */
37
#include <SDL3/SDL_main.h>
38
#include <SDL3/SDL_test.h>
43
static int run_test(void);
45
/* FIXME: Need CMake tests for this */
46
#if (defined(HAVE_LIBUDEV_H) || defined(SDL_JOYSTICK_LINUX)) && defined(HAVE_LINUX_INPUT_H)
50
#include "../src/core/linux/SDL_evdev_capabilities.h"
51
#include "../src/core/linux/SDL_evdev_capabilities.c"
60
SDL_UDEV_DEVICE_##x, #x \
77
const char *eviocgname;
78
const char *usb_vendor_name;
79
const char *usb_product_name;
84
uint16_t usb_device_version;
85
uint8_t ev[(EV_MAX + 1) / 8];
86
uint8_t keys[(KEY_MAX + 1) / 8];
87
uint8_t abs[(ABS_MAX + 1) / 8];
88
uint8_t rel[(REL_MAX + 1) / 8];
89
uint8_t ff[(FF_MAX + 1) / 8];
90
uint8_t props[(INPUT_PROP_MAX + 1) / 8];
93
size_t hid_report_descriptor_length;
94
const unsigned char *hid_report_descriptor;
98
* Test-cases for guessing a device type from its capabilities.
100
* The bytes in ev, etc. are in little-endian byte order
101
* Trailing zeroes can be omitted.
103
* The evemu-describe tool is a convenient way to add a test-case for
104
* a physically available device. To contribute new test-cases, see:
105
* https://github.com/libsdl-org/SDL/issues/7801#issuecomment-1589114910
107
#define ZEROx4 0, 0, 0, 0
108
#define ZEROx8 ZEROx4, ZEROx4
109
#define FFx4 0xff, 0xff, 0xff, 0xff
110
#define FFx8 FFx4, FFx4
112
static unsigned char xbox_one_elite_2_hid_report_descriptor[] =
114
/* Generic Desktop / Game Pad, Generic Desktop / Keyboard */
115
0x05, 0x01, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x01,
116
0x09, 0x01, 0xa1, 0x00, 0x09, 0x30, 0x09, 0x31,
117
0x15, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x95,
118
0x02, 0x75, 0x10, 0x81, 0x02, 0xc0, 0x09, 0x01,
119
0xa1, 0x00, 0x09, 0x32, 0x09, 0x35, 0x15, 0x00,
120
0x27, 0xff, 0xff, 0x00, 0x00, 0x95, 0x02, 0x75,
121
0x10, 0x81, 0x02, 0xc0, 0x05, 0x02, 0x09, 0xc5,
122
0x15, 0x00, 0x26, 0xff, 0x03, 0x95, 0x01, 0x75,
123
0x0a, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00, 0x75,
124
0x06, 0x95, 0x01, 0x81, 0x03, 0x05, 0x02, 0x09,
125
0xc4, 0x15, 0x00, 0x26, 0xff, 0x03, 0x95, 0x01,
126
0x75, 0x0a, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00,
127
0x75, 0x06, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01,
128
0x09, 0x39, 0x15, 0x01, 0x25, 0x08, 0x35, 0x00,
129
0x46, 0x3b, 0x01, 0x66, 0x14, 0x00, 0x75, 0x04,
130
0x95, 0x01, 0x81, 0x42, 0x75, 0x04, 0x95, 0x01,
131
0x15, 0x00, 0x25, 0x00, 0x35, 0x00, 0x45, 0x00,
132
0x65, 0x00, 0x81, 0x03, 0x05, 0x09, 0x19, 0x01,
133
0x29, 0x0f, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01,
134
0x95, 0x0f, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00,
135
0x75, 0x01, 0x95, 0x01, 0x81, 0x03, 0x05, 0x0c,
136
0x0a, 0xb2, 0x00, 0x15, 0x00, 0x25, 0x01, 0x95,
137
0x01, 0x75, 0x01, 0x81, 0x02, 0x15, 0x00, 0x25,
138
0x00, 0x75, 0x07, 0x95, 0x01, 0x81, 0x03, 0x05,
139
0x0c, 0x09, 0x01, 0xa1, 0x01, 0x0a, 0x85, 0x00,
140
0x15, 0x00, 0x26, 0xff, 0x00, 0x95, 0x01, 0x75,
141
0x08, 0x81, 0x02, 0x0a, 0x99, 0x00, 0x15, 0x00,
142
0x26, 0xff, 0x00, 0x95, 0x01, 0x75, 0x04, 0x81,
143
0x02, 0x15, 0x00, 0x25, 0x00, 0x95, 0x01, 0x75,
144
0x04, 0x81, 0x03, 0x0a, 0x81, 0x00, 0x15, 0x00,
145
0x26, 0xff, 0x00, 0x95, 0x01, 0x75, 0x04, 0x81,
146
0x02, 0x15, 0x00, 0x25, 0x00, 0x95, 0x01, 0x75,
147
0x04, 0x81, 0x03, 0xc0, 0x05, 0x0f, 0x09, 0x21,
148
0x85, 0x03, 0xa1, 0x02, 0x09, 0x97, 0x15, 0x00,
149
0x25, 0x01, 0x75, 0x04, 0x95, 0x01, 0x91, 0x02,
150
0x15, 0x00, 0x25, 0x00, 0x75, 0x04, 0x95, 0x01,
151
0x91, 0x03, 0x09, 0x70, 0x15, 0x00, 0x25, 0x64,
152
0x75, 0x08, 0x95, 0x04, 0x91, 0x02, 0x09, 0x50,
153
0x66, 0x01, 0x10, 0x55, 0x0e, 0x15, 0x00, 0x26,
154
0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91, 0x02,
155
0x09, 0xa7, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75,
156
0x08, 0x95, 0x01, 0x91, 0x02, 0x65, 0x00, 0x55,
157
0x00, 0x09, 0x7c, 0x15, 0x00, 0x26, 0xff, 0x00,
158
0x75, 0x08, 0x95, 0x01, 0x91, 0x02, 0xc0, 0x05,
159
0x0c, 0x09, 0x01, 0x85, 0x0c, 0xa1, 0x01, 0x0a,
160
0x9e, 0x00, 0x15, 0x00, 0x26, 0xff, 0x00, 0x95,
161
0x01, 0x75, 0x08, 0x81, 0x02, 0x0a, 0xa1, 0x00,
162
0x15, 0x00, 0x26, 0xff, 0x00, 0x95, 0x01, 0x75,
163
0x08, 0x81, 0x02, 0x0a, 0xa2, 0x00, 0x15, 0x00,
164
0x26, 0xff, 0x00, 0x95, 0x01, 0x75, 0x08, 0x81,
165
0x02, 0x0a, 0xa3, 0x00, 0x15, 0x00, 0x26, 0xff,
166
0x00, 0x95, 0x01, 0x75, 0x08, 0x81, 0x02, 0xc0,
167
0xc0, 0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x85,
168
0x05, 0x05, 0x07, 0x19, 0xe0, 0x29, 0xe7, 0x15,
169
0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x08, 0x81,
170
0x02, 0x95, 0x01, 0x75, 0x08, 0x81, 0x03, 0x95,
171
0x06, 0x75, 0x08, 0x15, 0x00, 0x25, 0x65, 0x05,
172
0x07, 0x19, 0x00, 0x29, 0x65, 0x81, 0x00, 0xc0,
174
SDL_COMPILE_TIME_ASSERT (xbox_one_elite_2, sizeof (xbox_one_elite_2_hid_report_descriptor) == 0720);
176
static unsigned char ps3_hid_report_descriptor[] =
178
/* Generic Desktop / Joystick */
179
0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0xa1, 0x02,
180
0x85, 0x01, 0x75, 0x08, 0x95, 0x01, 0x15, 0x00,
181
0x26, 0xff, 0x00, 0x81, 0x03, 0x75, 0x01, 0x95,
182
0x13, 0x15, 0x00, 0x25, 0x01, 0x35, 0x00, 0x45,
183
0x01, 0x05, 0x09, 0x19, 0x01, 0x29, 0x13, 0x81,
184
0x02, 0x75, 0x01, 0x95, 0x0d, 0x06, 0x00, 0xff,
185
0x81, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x05,
186
0x01, 0x09, 0x01, 0xa1, 0x00, 0x75, 0x08, 0x95,
187
0x04, 0x35, 0x00, 0x46, 0xff, 0x00, 0x09, 0x30,
188
0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x81, 0x02,
189
0xc0, 0x05, 0x01, 0x75, 0x08, 0x95, 0x27, 0x09,
190
0x01, 0x81, 0x02, 0x75, 0x08, 0x95, 0x30, 0x09,
191
0x01, 0x91, 0x02, 0x75, 0x08, 0x95, 0x30, 0x09,
192
0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02, 0x85, 0x02,
193
0x75, 0x08, 0x95, 0x30, 0x09, 0x01, 0xb1, 0x02,
194
0xc0, 0xa1, 0x02, 0x85, 0xee, 0x75, 0x08, 0x95,
195
0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02,
196
0x85, 0xef, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01,
197
0xb1, 0x02, 0xc0, 0xc0, 0x00,
199
SDL_COMPILE_TIME_ASSERT (ps3, sizeof (ps3_hid_report_descriptor) == 149);
201
/* Same for Steam Deck LCD (jupiter) and OLED (galileo) */
202
static unsigned char steam_deck_mouse_hid_report_descriptor[] =
204
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x01,
205
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x02,
206
0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02,
207
0x81, 0x02, 0x75, 0x06, 0x95, 0x01, 0x81, 0x01,
208
0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81,
209
0x25, 0x7f, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06,
210
0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c,
211
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0,
214
SDL_COMPILE_TIME_ASSERT (steam_deck_mouse,
215
sizeof (steam_deck_mouse_hid_report_descriptor) == 65);
217
/* Same for Steam Deck LCD (jupiter) and OLED (galileo) */
218
static unsigned char steam_deck_kb_hid_report_descriptor[] =
220
0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07,
221
0x19, 0xe0, 0x29, 0xe7, 0x15, 0x00, 0x25, 0x01,
222
0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x81, 0x01,
223
0x19, 0x00, 0x29, 0x65, 0x15, 0x00, 0x25, 0x65,
224
0x75, 0x08, 0x95, 0x06, 0x81, 0x00, 0xc0,
226
SDL_COMPILE_TIME_ASSERT (steam_deck_oled_kb,
227
sizeof (steam_deck_kb_hid_report_descriptor) == 39);
229
static unsigned char steam_deck_lcd_js_hid_report_descriptor[] =
231
0x06, 0xff, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x15,
232
0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x40,
233
0x09, 0x01, 0x81, 0x02, 0x09, 0x01, 0xb1, 0x02,
236
SDL_COMPILE_TIME_ASSERT (steam_deck_lcd_js,
237
sizeof (steam_deck_lcd_js_hid_report_descriptor) == 25);
239
static unsigned char steam_deck_oled_js_hid_report_descriptor[] =
241
0x06, 0xff, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x09,
242
0x02, 0x09, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00,
243
0x75, 0x08, 0x95, 0x40, 0x81, 0x02, 0x09, 0x06,
244
0x09, 0x07, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75,
245
0x08, 0x95, 0x40, 0xb1, 0x02, 0xc0,
247
SDL_COMPILE_TIME_ASSERT (steam_deck_oled_js,
248
sizeof (steam_deck_oled_js_hid_report_descriptor) == 38);
250
static unsigned char vrs_pedals_hid_report_descriptor[] =
252
/* Generic Desktop / Joystick */
253
0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0x05, 0x01,
254
0xa1, 0x02, 0x85, 0x01, 0x09, 0x30, 0x09, 0x31,
255
0x09, 0x32, 0x15, 0x00, 0x27, 0xff, 0xff, 0x00,
256
0x00, 0x35, 0x00, 0x47, 0xff, 0xff, 0x00, 0x00,
257
0x75, 0x10, 0x95, 0x03, 0x81, 0x02, 0x06, 0x00,
258
0xff, 0x09, 0x01, 0x95, 0x39, 0x75, 0x08, 0x26,
259
0xff, 0x00, 0x15, 0x00, 0x81, 0x02, 0xc0, 0x06,
260
0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x64,
261
0x95, 0x3f, 0x75, 0x08, 0x26, 0xff, 0x00, 0x15,
262
0x00, 0x09, 0x01, 0x91, 0x02, 0x85, 0x65, 0x95,
263
0x3f, 0x75, 0x08, 0x26, 0xff, 0x00, 0x15, 0x00,
264
0x09, 0x01, 0x81, 0x02, 0xc0, 0xc0,
266
SDL_COMPILE_TIME_ASSERT (vrs_pedals, sizeof (vrs_pedals_hid_report_descriptor) == 0136);
268
static unsigned char thinkpad_usb_keyboard_hid_report_descriptor[] =
270
/* Generic Desktop / Keyboard */
271
0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07,
272
0x19, 0xe0, 0x29, 0xe7, 0x15, 0x00, 0x25, 0x01,
273
0x95, 0x08, 0x75, 0x01, 0x81, 0x02, 0x95, 0x08,
274
0x75, 0x01, 0x81, 0x01, 0x05, 0x08, 0x19, 0x01,
275
0x29, 0x03, 0x95, 0x03, 0x75, 0x01, 0x91, 0x02,
276
0x95, 0x01, 0x75, 0x05, 0x91, 0x01, 0x05, 0x07,
277
0x19, 0x00, 0x2a, 0xff, 0x00, 0x15, 0x00, 0x26,
278
0xff, 0x00, 0x95, 0x06, 0x75, 0x08, 0x81, 0x00,
281
SDL_COMPILE_TIME_ASSERT (thinkpad_usb_keyboard, sizeof (thinkpad_usb_keyboard_hid_report_descriptor) == 65);
283
static unsigned char thinkpad_usb_trackpoint_hid_report_descriptor[] =
285
/* Generic Desktop / Mouse, Generic Desktop / System Control,
286
* Consumer Devices / Consumer Control */
287
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x01,
288
0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01,
289
0x29, 0x03, 0x15, 0x00, 0x25, 0x01, 0x95, 0x03,
290
0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x05,
291
0x81, 0x01, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31,
292
0x15, 0x81, 0x25, 0x7f, 0x95, 0x02, 0x75, 0x08,
293
0x81, 0x06, 0xc0, 0xc0, 0x05, 0x01, 0x09, 0x80,
294
0xa1, 0x01, 0x85, 0x02, 0x05, 0x01, 0x15, 0x00,
295
0x25, 0x01, 0x95, 0x08, 0x75, 0x01, 0x19, 0x81,
296
0x29, 0x88, 0x81, 0x02, 0xc0, 0x05, 0x0c, 0x09,
297
0x01, 0xa1, 0x01, 0x85, 0x03, 0x95, 0x08, 0x75,
298
0x01, 0x15, 0x00, 0x25, 0x01, 0x09, 0xe9, 0x09,
299
0xea, 0x09, 0xe2, 0x09, 0xb7, 0x09, 0xcd, 0x09,
300
0xb5, 0x09, 0xb6, 0x0a, 0x94, 0x01, 0x81, 0x02,
301
0x09, 0x03, 0xa1, 0x02, 0x05, 0x09, 0x19, 0x10,
302
0x29, 0x17, 0x81, 0x02, 0x05, 0x09, 0x19, 0x18,
303
0x29, 0x1f, 0x81, 0x02, 0xc0, 0x05, 0x08, 0x95,
304
0x02, 0x09, 0x09, 0x09, 0x21, 0x91, 0x02, 0x95,
305
0x01, 0x75, 0x06, 0x91, 0x03, 0xc0, 0x06, 0x01,
306
0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x04, 0x95,
307
0x01, 0x75, 0x08, 0x15, 0x00, 0x26, 0xff, 0x00,
308
0x09, 0x20, 0xb1, 0x03, 0x09, 0x21, 0xb1, 0x03,
309
0x09, 0x22, 0xb1, 0x03, 0x09, 0x23, 0xb1, 0x03,
312
SDL_COMPILE_TIME_ASSERT (thinkpad_usb_trackpoint, sizeof (thinkpad_usb_trackpoint_hid_report_descriptor) == 185);
314
static unsigned char heusinkveld_pedals_hid_report_descriptor[] =
316
/* Generic Desktop / Joystick */
317
0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0x09, 0x33,
318
0x09, 0x34, 0x09, 0x35, 0x15, 0x00, 0x26, 0xff,
319
0x0f, 0x85, 0x01, 0x75, 0x10, 0x95, 0x03, 0x81,
320
0x02, 0x09, 0x00, 0x75, 0x10, 0x95, 0x06, 0x82,
321
0x01, 0x01, 0x85, 0x02, 0x75, 0x10, 0x95, 0x03,
322
0x09, 0x00, 0x09, 0x00, 0xb1, 0x02, 0x85, 0x03,
323
0x75, 0x08, 0x95, 0x03, 0x09, 0x00, 0x82, 0x01,
326
SDL_COMPILE_TIME_ASSERT (heusinkveld_pedals, sizeof (heusinkveld_pedals_hid_report_descriptor) == 072);
328
static unsigned char fanatec_handbrake_hid_report_descriptor[] =
330
/* Generic Desktop / Joystick */
331
0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0x15, 0x00,
332
0x26, 0xff, 0x00, 0x95, 0x01, 0x75, 0x08, 0x09,
333
0x30, 0x81, 0x02, 0x06, 0x00, 0xff, 0x09, 0x01,
334
0x95, 0x03, 0x81, 0x02, 0x06, 0x00, 0xff, 0x09,
335
0x01, 0x95, 0x02, 0x91, 0x02, 0xc0,
337
SDL_COMPILE_TIME_ASSERT (fanatec_handbrake, sizeof (fanatec_handbrake_hid_report_descriptor) == 046);
339
static unsigned char xpadneo09_xb1s_hid_report_descriptor[] =
341
0x05, 0x01, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x01,
342
0x09, 0x01, 0xa1, 0x00, 0x09, 0x30, 0x09, 0x31,
343
0x15, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x95,
344
0x02, 0x75, 0x10, 0x81, 0x02, 0xc0, 0x09, 0x01,
345
0xa1, 0x00, 0x09, 0x33, 0x09, 0x34, 0x15, 0x00,
346
0x27, 0xff, 0xff, 0x00, 0x00, 0x95, 0x02, 0x75,
347
0x10, 0x81, 0x02, 0xc0, 0x05, 0x01, 0x09, 0x32,
348
0x15, 0x00, 0x26, 0xff, 0x03, 0x95, 0x01, 0x75,
349
0x0a, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00, 0x75,
350
0x06, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01, 0x09,
351
0x35, 0x15, 0x00, 0x26, 0xff, 0x03, 0x95, 0x01,
352
0x75, 0x0a, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00,
353
0x75, 0x06, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01,
354
0x09, 0x39, 0x15, 0x01, 0x25, 0x08, 0x35, 0x00,
355
0x46, 0x3b, 0x01, 0x66, 0x14, 0x00, 0x75, 0x04,
356
0x95, 0x01, 0x81, 0x42, 0x75, 0x04, 0x95, 0x01,
357
0x15, 0x00, 0x25, 0x00, 0x35, 0x00, 0x45, 0x00,
358
0x65, 0x00, 0x81, 0x03, 0x05, 0x09, 0x19, 0x01,
359
0x29, 0x0c, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01,
360
0x95, 0x0c, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00,
361
0x75, 0x01, 0x95, 0x04, 0x81, 0x03, 0x05, 0x0c,
362
0x0a, 0xb2, 0x00, 0x15, 0x00, 0x25, 0x01, 0x95,
363
0x01, 0x75, 0x01, 0x81, 0x02, 0x15, 0x00, 0x25,
364
0x00, 0x75, 0x07, 0x95, 0x01, 0x81, 0x03, 0x05,
365
0x0f, 0x09, 0x21, 0x85, 0x03, 0xa1, 0x02, 0x09,
366
0x97, 0x15, 0x00, 0x25, 0x01, 0x75, 0x04, 0x95,
367
0x01, 0x91, 0x02, 0x15, 0x00, 0x25, 0x00, 0x75,
368
0x04, 0x95, 0x01, 0x91, 0x03, 0x09, 0x70, 0x15,
369
0x00, 0x25, 0x64, 0x75, 0x08, 0x95, 0x04, 0x91,
370
0x02, 0x09, 0x50, 0x66, 0x01, 0x10, 0x55, 0x0e,
371
0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95,
372
0x01, 0x91, 0x02, 0x09, 0xa7, 0x15, 0x00, 0x26,
373
0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91, 0x02,
374
0x65, 0x00, 0x55, 0x00, 0x09, 0x7c, 0x15, 0x00,
375
0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91,
378
SDL_COMPILE_TIME_ASSERT (xpadneo09_xb1s, sizeof (xpadneo09_xb1s_hid_report_descriptor) == 283);
380
/* Test-cases derived from real devices or from Linux kernel source */
381
/* *INDENT-OFF* */ /* clang-format off */
382
static const GuessTest guess_tests[] =
385
.name = "Xbox 360 wired USB controller",
386
.eviocgname = "Microsoft X-Box 360 pad",
387
.usb_vendor_name = "©Microsoft Corporation",
388
.usb_product_name = "Controller",
389
/* 8BitDo N30 Pro 2 v0114 via USB-C (with the xpad driver) is
390
* reported as 0003:045e:028e v0114, and is functionally equivalent */
393
.product_id = 0x028e,
395
.expected = SDL_UDEV_DEVICE_JOYSTICK,
396
/* SYN, KEY, ABS, FF */
397
.ev = { 0x0b, 0x00, 0x20 },
398
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
399
.abs = { 0x3f, 0x00, 0x03 },
401
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
402
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
403
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
407
.name = "X-Box One Elite",
410
.product_id = 0x02e3,
411
.expected = SDL_UDEV_DEVICE_JOYSTICK,
414
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
415
.abs = { 0x3f, 0x00, 0x03 },
417
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
418
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
419
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
422
{ /* Reference: https://github.com/libsdl-org/SDL/issues/7814 */
423
.name = "X-Box One Elite 2 via USB",
424
/* The same physical device via Bluetooth, 0005:045e:0b22 v0517,
425
* is reported differently (below). */
426
/* Version 0407 is functionally equivalent. */
429
.product_id = 0x0b00,
431
.expected = SDL_UDEV_DEVICE_JOYSTICK,
432
/* SYN, KEY, ABS, FF */
433
.ev = { 0x0b, 0x00, 0x20 },
434
/* XY (left stick), RX/RY (right stick), Z/RZ (triggers), HAT0 (dpad) */
435
.abs = { 0x3f, 0x00, 0x03 },
437
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
438
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
439
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
446
/* BTN_TRIGGER_HAPPY5 up to BTN_TRIGGER_HAPPY8 inclusive are the
447
* back buttons (paddles) */
451
{ /* Reference: https://github.com/libsdl-org/SDL/issues/7814 */
452
.name = "X-Box One Elite 2 via Bluetooth",
453
/* The same physical device via USB, 0003:045e:0b00 v0511,
454
* is reported differently (above). */
457
.product_id = 0x0b22,
459
.expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_HAS_KEYS,
460
/* SYN, KEY, ABS, FF */
461
.ev = { 0x0b, 0x00, 0x20 },
462
/* Android-style mapping:
463
* XY (left stick), Z/RZ (right stick), GAS/BRAKE (triggers), HAT0 (dpad) */
464
.abs = { 0x27, 0x06, 0x03 },
468
/* KEY_RECORD is advertised but isn't generated in practice */
469
/* 0x80 */ ZEROx4, 0x80, 0x00, 0x00, 0x00,
470
/* KEY_UNKNOWN (240) is reported for the profile selector and all
471
* four back buttons (paddles) */
472
/* 0xc0 */ ZEROx4, 0x00, 0x00, 0x01, 0x00,
473
/* ABXY, TL, TR, TL2, TR2, SELECT, START, MODE, THUMBL,
474
* THUMBR have their obvious meanings; C and Z are also
475
* advertised, but are not generated in practice. */
476
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x7f,
478
.hid_report_descriptor_length = sizeof (xbox_one_elite_2_hid_report_descriptor),
479
.hid_report_descriptor = &xbox_one_elite_2_hid_report_descriptor[0],
482
.name = "X-Box One S via Bluetooth",
485
.product_id = 0x02e0,
487
.expected = SDL_UDEV_DEVICE_JOYSTICK,
490
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
491
.abs = { 0x3f, 0x00, 0x03 },
493
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
494
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
495
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
499
.name = "X-Box One S wired",
502
.product_id = 0x02ea,
504
.expected = SDL_UDEV_DEVICE_JOYSTICK,
507
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
508
.abs = { 0x3f, 0x00, 0x03 },
510
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
511
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
512
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
516
.name = "X-Box One S via xpadneo 0.9.x",
517
/* Reference: https://github.com/libsdl-org/SDL/issues/7823 */
518
.eviocgname = "Xbox Wireless Controller",
521
.product_id = 0x028e,
523
.expected = SDL_UDEV_DEVICE_JOYSTICK,
524
/* SYN, KEY, ABS, MSC, FF */
526
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y
527
* plus MISC as a deprecated axis reporting (rz - z) */
528
.abs = { 0x3f, 0x00, 0x03, 0x00, 0x00, 0x01 },
530
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
531
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
532
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
539
/* BTN_TRIGGER_HAPPY33 up to BTN_TRIGGER_HAPPY36 inclusive:
540
* used to represent the current profile */
541
/* 0x2c0 */ ZEROx4, 0xf0,
543
.hid_report_descriptor_length = sizeof (xpadneo09_xb1s_hid_report_descriptor),
544
.hid_report_descriptor = &xpadneo09_xb1s_hid_report_descriptor[0],
547
.name = "DualSense (PS5) - gamepad",
550
.product_id = 0x0ce6,
552
.expected = SDL_UDEV_DEVICE_JOYSTICK,
555
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
556
.abs = { 0x3f, 0x00, 0x03 },
558
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
559
/* ABC, XYZ, TL, TR, TL2, TR2, select, start, mode, thumbl,
560
* thumbr; note that C and Z don't physically exist */
561
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x7f,
565
.name = "DualSense (PS5) v8111 - gamepad",
566
.eviocgname = "Sony Interactive Entertainment Wireless Controller",
567
.usb_vendor_name = "Sony Interactive Entertainment",
568
.usb_product_name = "Wireless Controller",
569
/* Same physical device via Bluetooth is 0005:054c:0ce6 v8100
570
* and EVIOCGNAME is just "Wireless Controller", otherwise equivalent */
573
.product_id = 0x0ce6,
575
.expected = SDL_UDEV_DEVICE_JOYSTICK,
578
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
579
.abs = { 0x3f, 0x00, 0x03 },
581
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
582
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
584
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7f,
588
.name = "DualShock 4 - gamepad",
589
/* EVIOCGNAME is just "Wireless Controller" when seen via Bluetooth */
590
.eviocgname = "Sony Interactive Entertainment Wireless Controller",
591
.usb_vendor_name = "Sony Interactive Entertainment",
592
.usb_product_name = "Wireless Controller",
593
/* Same physical device via Bluetooth is 0005:054c:09cc v8100,
594
* but otherwise equivalent */
597
.product_id = 0x09cc,
599
.expected = SDL_UDEV_DEVICE_JOYSTICK,
600
/* SYN, KEY, ABS, MSC, FF */
601
/* Some versions only have 0x0b, SYN, KEY, ABS, like the
602
* Bluetooth example below */
603
.ev = { 0x1b, 0x00, 0x20 },
604
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
605
.abs = { 0x3f, 0x00, 0x03 },
607
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
608
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
610
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7f,
614
.name = "DualShock 4 - gamepad via Bluetooth (unknown version)",
617
.product_id = 0x09cc,
618
.expected = SDL_UDEV_DEVICE_JOYSTICK,
621
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
622
.abs = { 0x3f, 0x00, 0x03 },
624
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
625
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
627
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7f,
631
.name = "DualShock 4 - touchpad",
632
/* EVIOCGNAME is just "Wireless Controller Touchpad" when seen via Bluetooth */
633
.eviocgname = "Sony Interactive Entertainment Wireless Controller Touchpad",
634
.usb_vendor_name = "Sony Interactive Entertainment",
635
.usb_product_name = "Wireless Controller",
636
/* Same physical device via Bluetooth is 0005:054c:09cc v8100 and is
637
* functionally equivalent. */
638
/* DualSense (PS5), 0003:054c:0ce6 v8111, is functionally equivalent.
639
* Same physical device via Bluetooth is 0005:054c:0ce6 v8100 and also
640
* functionally equivalent. */
643
.product_id = 0x09cc,
645
.expected = SDL_UDEV_DEVICE_TOUCHPAD,
648
/* X, Y, multitouch */
649
.abs = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x02 },
651
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
652
/* Left mouse button */
653
/* 0x100 */ 0x00, 0x00, 0x01, 0x00, ZEROx4,
654
/* BTN_TOOL_FINGER and some multitouch stuff */
655
/* 0x140 */ 0x20, 0x24, 0x00, 0x00
657
/* POINTER, BUTTONPAD */
661
.name = "DualShock 4 - accelerometer",
662
/* EVIOCGNAME is just "Wireless Controller Motion Sensors" when seen via Bluetooth */
663
.eviocgname = "Sony Interactive Entertainment Wireless Controller Motion Sensors",
664
.usb_vendor_name = "Sony Interactive Entertainment",
665
.usb_product_name = "Wireless Controller",
666
/* Same physical device via Bluetooth is 0005:054c:09cc v8100 and is
667
* functionally equivalent. */
668
/* DualSense (PS5), 0003:054c:0ce6 v8111, is functionally equivalent.
669
* Same physical device via Bluetooth is 0005:054c:0ce6 v8100 and also
670
* functionally equivalent. */
673
.product_id = 0x09cc,
675
.expected = SDL_UDEV_DEVICE_ACCELEROMETER,
678
/* X, Y, Z, RX, RY, RZ */
684
.name = "DualShock 4 via USB dongle",
687
.product_id = 0x0ba0,
689
.expected = SDL_UDEV_DEVICE_JOYSTICK,
692
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
693
.abs = { 0x3f, 0x00, 0x03 },
695
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
696
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
698
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7f,
702
.name = "DualShock 3 - gamepad",
703
.eviocgname = "Sony PLAYSTATION(R)3 Controller",
704
.usb_vendor_name = "Sony",
705
.usb_product_name = "PLAYSTATION(R)3 Controller",
708
.product_id = 0x0268,
710
.expected = SDL_UDEV_DEVICE_JOYSTICK,
711
/* SYN, KEY, ABS, MSC, FF */
712
.ev = { 0x1b, 0x00, 0x20 },
713
/* X, Y, Z, RX, RY, RZ */
716
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
717
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
719
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7f,
724
/* 0x200 */ ZEROx4, 0x0f, 0x00, 0x00, 0x00,
726
.hid_report_descriptor_length = sizeof (ps3_hid_report_descriptor),
727
.hid_report_descriptor = &ps3_hid_report_descriptor[0],
730
.name = "DualShock 3 - accelerometer",
731
.eviocgname = "Sony PLAYSTATION(R)3 Controller Motion Sensors",
732
.usb_vendor_name = "Sony",
733
.usb_product_name = "PLAYSTATION(R)3 Controller",
736
.product_id = 0x0268,
737
.expected = SDL_UDEV_DEVICE_ACCELEROMETER,
744
.hid_report_descriptor_length = sizeof (ps3_hid_report_descriptor),
745
.hid_report_descriptor = &ps3_hid_report_descriptor[0],
748
.name = "Steam Controller - gamepad",
751
.product_id = 0x1142,
752
.expected = SDL_UDEV_DEVICE_JOYSTICK,
755
/* X, Y, RX, RY, HAT0X, HAT0Y, HAT2X, HAT2Y */
756
.abs = { 0x1b, 0x00, 0x33 },
758
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
759
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
760
* THUMBL, THUMBR, joystick THUMB, joystick THUMB2 */
761
/* 0x100 */ ZEROx4, 0x06, 0x00, 0xdb, 0x7f,
762
/* GEAR_DOWN, GEAR_UP */
763
/* 0x140 */ 0x00, 0x00, 0x03, 0x00, ZEROx4,
767
/* 0x200 */ ZEROx4, 0x0f, 0x00, 0x00, 0x00,
771
/* Present to support lizard mode, even if no Steam Controller
773
.name = "Steam Controller - dongle",
776
.product_id = 0x1142,
777
.expected = (SDL_UDEV_DEVICE_HAS_KEYS
778
| SDL_UDEV_DEVICE_KEYBOARD
779
| SDL_UDEV_DEVICE_MOUSE),
780
/* SYN, KEY, REL, MSC, LED, REP */
781
.ev = { 0x17, 0x00, 0x12 },
782
/* X, Y, mouse wheel, high-res mouse wheel */
783
.rel = { 0x03, 0x09 },
785
/* 0x00 */ 0xfe, 0xff, 0xff, 0xff, FFx4,
786
/* 0x40 */ 0xff, 0xff, 0xcf, 0x01, 0xdf, 0xff, 0x80, 0xe0,
789
/* 0x100 */ 0x00, 0x00, 0x1f, 0x00, ZEROx4,
793
.name = "Steam Deck - mouse",
794
/* This is the LCD model (jupiter).
795
* Steam Deck OLED (galileo, possibly pre-production) has
796
* .eviocgname = "Valve Software Steam Controller"
798
* .usb_device_version = 0x0300
799
* but is otherwise equivalent.
801
.eviocgname = "Valve Software Steam Deck Controller",
802
.usb_vendor_name = "Valve Software",
803
.usb_product_name = "Steam Deck Controller",
806
.product_id = 0x1205,
808
.usb_device_version = 0x0200,
809
/* SYN, KEY, REL, MSC */
811
/* X, Y, mouse wheel v/h, high-res mouse wheel v/h */
812
.rel = { 0x43, 0x19 },
814
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
815
/* left/right mouse button */
816
/* 0x100 */ 0x00, 0x00, 0x03, 0x00, ZEROx4,
818
.expected = SDL_UDEV_DEVICE_MOUSE,
819
.hid_report_descriptor_length = sizeof (steam_deck_mouse_hid_report_descriptor),
820
.hid_report_descriptor = &steam_deck_mouse_hid_report_descriptor[0],
823
.name = "Steam Deck - keyboard",
824
/* This is the LCD model (jupiter).
825
* Steam Deck OLED (galileo, possibly pre-production) has
826
* .eviocgname = "Valve Software Steam Controller"
828
* .usb_device_version = 0x0300
829
* but is otherwise equivalent.
831
.eviocgname = "Valve Software Steam Deck Controller",
832
.usb_vendor_name = "Valve Software",
833
.usb_product_name = "Steam Deck Controller",
836
.product_id = 0x1205,
838
.usb_device_version = 0x0300,
839
/* SYN, KEY, MSC, REP */
840
.ev = { 0x13, 0x00, 0x10 },
842
/* 0x00 */ 0xfe, 0xff, 0xff, 0xff, FFx4,
843
/* 0x40 */ 0xff, 0xff, 0xcf, 0x01, 0xdf, 0xff, 0x80, 0xe0,
845
.expected = SDL_UDEV_DEVICE_KEYBOARD | SDL_UDEV_DEVICE_HAS_KEYS,
846
.hid_report_descriptor_length = sizeof (steam_deck_kb_hid_report_descriptor),
847
.hid_report_descriptor = &steam_deck_kb_hid_report_descriptor[0],
850
.name = "Steam Deck LCD - gamepad",
851
.eviocgname = "Valve Software Steam Deck Controller",
852
.usb_vendor_name = "Valve Software",
853
.usb_product_name = "Steam Deck Controller",
856
.product_id = 0x1205,
858
.usb_device_version = 0x0200,
859
.expected = SDL_UDEV_DEVICE_JOYSTICK,
860
/* TODO: The data I have for Steam Deck LCD didn't seem to have
861
* an evdev device available, so this is extrapolated from
862
* kernel source code as being the same as the OLED model
863
* (the kernel driver doesn't distinguish). */
866
/* X, Y, RX, RY, hat 0-2 x/y */
867
.abs = { 0x1b, 0x00, 0x3f },
869
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
870
/* 0x120 0x46: joystick THUMB, THUMB2, BASE */
871
/* 0x130 0xdb: gamepad ABXY, TL/TR */
872
/* 0x138 0x7f: gamepad TL2/TR2, SELECT/START, MODE, THUMBL/R */
873
/* 0x100 */ ZEROx4, 0x46, 0x00, 0xdb, 0x7f,
877
/* 0x220 0x0f: dpad up/down/left/right */
878
/* 0x200 */ ZEROx4, 0x0f, 0x00, 0x00, 0x00,
881
/* 0x2c0 0x0f: joystick TRIGGER_HAPPY1..TRIGGER_HAPPY4 */
884
.hid_report_descriptor_length = sizeof (steam_deck_lcd_js_hid_report_descriptor),
885
.hid_report_descriptor = &steam_deck_lcd_js_hid_report_descriptor[0],
888
.name = "Steam Deck OLED - gamepad",
889
.eviocgname = "Valve Software Steam Controller",
890
.usb_vendor_name = "Valve Software",
891
.usb_product_name = "Steam Controller",
894
.product_id = 0x1205,
896
.usb_device_version = 0x0300,
899
/* X, Y, RX, RY, hat 0-2 x/y */
900
.abs = { 0x1b, 0x00, 0x3f },
902
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
903
/* 0x120 0x46: joystick THUMB, THUMB2, BASE */
904
/* 0x130 0xdb: gamepad ABXY, TL/TR */
905
/* 0x138 0x7f: gamepad TL2/TR2, SELECT/START, MODE, THUMBL/R */
906
/* 0x100 */ ZEROx4, 0x46, 0x00, 0xdb, 0x7f,
910
/* 0x220 0x0f: dpad up/down/left/right */
911
/* 0x200 */ ZEROx4, 0x0f, 0x00, 0x00, 0x00,
914
/* 0x2c0 0x0f: joystick TRIGGER_HAPPY1..TRIGGER_HAPPY4 */
917
.expected = SDL_UDEV_DEVICE_JOYSTICK,
918
.hid_report_descriptor_length = sizeof (steam_deck_oled_js_hid_report_descriptor),
919
.hid_report_descriptor = &steam_deck_oled_js_hid_report_descriptor[0],
922
.name = "Steam Input virtual controller",
923
.eviocgname = "Microsoft X-Box 360 pad 0",
926
.product_id = 0x11ff,
928
.expected = SDL_UDEV_DEVICE_JOYSTICK,
929
/* SYN, KEY, ABS, FF */
930
.ev = { 0x0b, 0x00, 0x20 },
931
/* XYZ, RXYZ, hat 0 */
932
.abs = { 0x3f, 0x00, 0x03 },
934
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
935
/* 0x130 0xdb: gamepad ABXY, TL/TR */
936
/* 0x138 0x7f: gamepad SELECT/START, MODE, THUMBL/R */
937
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
941
.name = "Guitar Hero for PS3",
942
/* SWITCH CO.,LTD. Controller (Dinput) off-brand N64-style USB controller
943
* 0003:2563:0575 v0111 is functionally equivalent.
944
* https://linux-hardware.org/?id=usb:2563-0575 reports the same IDs as
945
* ShenZhen ShanWan Technology ZD-V+ Wired Gaming Controller */
948
.product_id = 0x0100,
950
.expected = SDL_UDEV_DEVICE_JOYSTICK,
953
/* X, Y, Z, RZ, HAT0X, HAT0Y */
954
.abs = { 0x27, 0x00, 0x03 },
956
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
957
/* ABC, XYZ, TL, TR, TL2, TR2, SELECT, START, MODE */
958
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x1f,
962
.name = "G27 Racing Wheel, 0003:046d:c29b v0111",
965
.product_id = 0xc29b,
967
.expected = SDL_UDEV_DEVICE_JOYSTICK,
970
/* X, Y, Z, RZ, HAT0X, HAT0Y */
971
.abs = { 0x27, 0x00, 0x03 },
973
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
974
/* 16 buttons: TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE, BASE,
975
* BASE2..BASE6, unregistered event codes 0x12c-0x12e, DEAD */
976
/* 0x100 */ ZEROx4, 0xff, 0xff, 0x00, 0x00,
983
/* TRIGGER_HAPPY1..TRIGGER_HAPPY7 */
988
.name = "Logitech Driving Force, 0003:046d:c294 v0100",
991
.product_id = 0xc294,
993
.expected = SDL_UDEV_DEVICE_JOYSTICK,
996
/* X, Y, RZ, HAT0X, HAT0Y */
997
.abs = { 0x23, 0x00, 0x03 },
999
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1000
/* 12 buttons: TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE, BASE,
1002
/* 0x100 */ ZEROx4, 0xff, 0x0f, 0x00, 0x00,
1006
.name = "Logitech Dual Action",
1008
.vendor_id = 0x046d,
1009
.product_id = 0xc216,
1011
/* Logitech RumblePad 2 USB, 0003:046d:c218 v0110, is the same
1012
* except for having force feedback, which we don't use in our
1014
/* Jess Tech GGE909 PC Recoil Pad, 0003:0f30:010b v0110, is the same */
1015
/* 8BitDo SNES30 via USB, 0003:2dc8:ab20 v0110, is the same;
1016
* see below for the same physical device via Bluetooth,
1017
* 0005:2dc8:2840 v0100 */
1018
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1021
/* X, Y, Z, RZ, HAT0X, HAT0Y */
1022
.abs = { 0x27, 0x00, 0x03 },
1024
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1025
/* 12 buttons: TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE, BASE,
1027
/* 0x100 */ ZEROx4, 0xff, 0x0f, 0x00, 0x00,
1031
.name = "8BitDo SNES30 v0100 via Bluetooth",
1032
.eviocgname = "8Bitdo SNES30 GamePad",
1033
/* The same physical device via USB, 0003:2dc8:ab20 v0110,
1034
* is reported differently (above). */
1035
/* 8BitDo NES30 Pro (aka N30 Pro) via Bluetooth, 0005:2dc8:3820 v0100,
1036
* is functionally equivalent; but the same physical device via USB,
1037
* 0003:2dc8:9001 v0111, matches N30 Pro 2 v0111. */
1039
.vendor_id = 0x2dc8,
1040
.product_id = 0x2840,
1042
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1043
/* SYN, KEY, ABS, MSC */
1045
/* XYZ, RZ, GAS, BRAKE, HAT0X, HAT0Y */
1046
.abs = { 0x27, 0x06, 0x03 },
1048
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1049
/* ABC, XYZ, TL, TR, TL2, TR2, SELECT, START, MODE, THUMBL, THUMBR,
1050
* and an unassigned button code */
1051
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0xff,
1055
.name = "Saitek ST290 Pro flight stick",
1057
.vendor_id = 0x06a3,
1058
.product_id = 0x0160, /* 0x0460 seems to be the same */
1060
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1061
/* SYN, KEY, ABS, MSC */
1063
/* X, Y, Z, RZ, HAT0X, HAT0Y */
1064
.abs = { 0x27, 0x00, 0x03 },
1066
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1067
/* TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE */
1068
/* 0x100 */ ZEROx4, 0x3f, 0x00, 0x00, 0x00,
1072
.name = "Saitek X52 Pro Flight Control System",
1074
.vendor_id = 0x06a3,
1075
.product_id = 0x0762,
1077
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1079
/* XYZ, RXYZ, throttle, hat0, MISC, unregistered event code 0x29 */
1080
.abs = { 0x7f, 0x00, 0x03, 0x00, 0x00, 0x03 },
1082
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1083
/* 16 buttons: TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE, BASE,
1084
* BASE2..BASE6, unregistered event codes 0x12c-0x12e, DEAD */
1085
/* 0x100 */ ZEROx4, 0xff, 0xff, 0x00, 0x00,
1092
/* TRIGGER_HAPPY1..TRIGGER_HAPPY23 */
1093
/* 0x2c0 */ 0xff, 0xff, 0x7f,
1097
.name = "Logitech Extreme 3D",
1099
.vendor_id = 0x046d,
1100
.product_id = 0xc215,
1102
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1103
/* SYN, KEY, ABS, MSC */
1105
/* X, Y, RZ, throttle, hat 0 */
1106
.abs = { 0x63, 0x00, 0x03 },
1108
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1109
/* 12 buttons: TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE, BASE,
1111
/* 0x100 */ ZEROx4, 0xff, 0x0f, 0x00, 0x00,
1115
.name = "Hori Real Arcade Pro VX-SA",
1117
.vendor_id = 0x24c6,
1118
.product_id = 0x5501,
1120
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1123
/* X, Y, Z, RX, RY, RZ, hat 0 */
1124
.abs = { 0x3f, 0x00, 0x03 },
1126
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1127
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
1128
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
1132
/* https://github.com/ValveSoftware/steam-devices/pull/42
1133
* PS4 mode is functionally equivalent, but with product ID 0x011c
1134
* and version 0x1101. */
1135
.name = "Hori Fighting Stick Alpha - PS5 mode",
1136
.bus_type = 0x0003, /* USB */
1137
.vendor_id = 0x0f0d, /* Hori Co., Ltd. */
1138
.product_id = 0x0184, /* HORI FIGHTING STICK α (PS5 mode) */
1140
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1141
/* SYN, KEY, ABS, MSC */
1143
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
1144
.abs = { 0x3f, 0x00, 0x03 },
1146
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1147
/* ABC, XYZ, TL, TR, TL2, TR2, SELECT, START, MODE,
1149
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x3f,
1152
{ /* https://github.com/ValveSoftware/steam-devices/pull/42 */
1153
.name = "Hori Fighting Stick Alpha - PC mode",
1154
.bus_type = 0x0003, /* USB */
1155
.vendor_id = 0x0f0d, /* Hori Co., Ltd. */
1156
.product_id = 0x011e, /* HORI FIGHTING STICK α (PC mode) */
1158
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1159
/* SYN, KEY, ABS, FF */
1160
.ev = { 0x0b, 0x00, 0x20 },
1161
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
1162
.abs = { 0x3f, 0x00, 0x03 },
1164
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1165
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
1166
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
1169
{ /* https://github.com/ValveSoftware/steam-devices/issues/29 */
1170
.name = "HORIPAD S for Nintendo",
1171
.bus_type = 0x0003, /* USB */
1172
.vendor_id = 0x0f0d, /* Hori Co., Ltd. */
1173
.product_id = 0x00dc, /* HORIPAD S */
1175
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1176
/* SYN, KEY, ABS, FF */
1177
.ev = { 0x0b, 0x00, 0x20 },
1178
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
1179
.abs = { 0x3f, 0x00, 0x03 },
1181
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1182
/* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
1183
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
1187
.name = "Switch Pro Controller via Bluetooth",
1189
.vendor_id = 0x057e,
1190
.product_id = 0x2009,
1192
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1195
/* X, Y, RX, RY, hat 0 */
1196
.abs = { 0x1b, 0x00, 0x03 },
1198
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1199
/* 16 buttons: TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE, BASE,
1200
* BASE2..BASE6, unregistered event codes 0x12c-0x12e, DEAD */
1201
/* 0x100 */ ZEROx4, 0xff, 0xff, 0x00, 0x00,
1208
/* TRIGGER_HAPPY1..TRIGGER_HAPPY2 */
1213
.name = "Switch Pro Controller via Bluetooth (Linux 6.2.11)",
1214
.eviocgname = "Pro Controller",
1216
.vendor_id = 0x057e,
1217
.product_id = 0x2009,
1219
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1222
/* X, Y, RX, RY, hat 0 */
1223
.abs = { 0x1b, 0x00, 0x03 },
1225
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1226
/* ABC, XYZ, TL, TR, TL2, TR2, SELECT, START, MODE, THUMBL, THUMBR,
1227
* and an unassigned button code */
1228
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0xff,
1232
.name = "Switch Pro Controller via USB",
1233
.eviocgname = "Nintendo Co., Ltd. Pro Controller",
1234
.usb_vendor_name = "Nintendo Co., Ltd.",
1235
.usb_product_name = "Pro Controller",
1237
.vendor_id = 0x057e,
1238
.product_id = 0x2009,
1240
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1243
/* X, Y, Z, RZ, HAT0X, HAT0Y */
1244
.abs = { 0x27, 0x00, 0x03 },
1246
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1247
/* 16 buttons: TRIGGER, THUMB, THUMB2, TOP, TOP2, PINKIE, BASE,
1248
* BASE2..BASE6, unregistered event codes 0x12c-0x12e, DEAD */
1249
/* 0x100 */ ZEROx4, 0xff, 0xff, 0x00, 0x00,
1256
/* TRIGGER_HAPPY1..TRIGGER_HAPPY2 */
1260
{ /* https://github.com/ValveSoftware/steam-devices/pull/40 */
1261
.name = "PDP wired Pro Controller for Switch",
1262
/* 0003:0e6f:0184 "Performance Designed Products" /
1263
* "Faceoff Deluxe+ Audio Wired Controller for Nintendo Switch" appears
1264
* to be functionally equivalent */
1265
.eviocgname = "PDP CO.,LTD. Faceoff Wired Pro Controller for Nintendo Switch",
1266
.usb_vendor_name = "PDP CO.,LTD.",
1267
.usb_product_name = "Faceoff Wired Pro Controller for Nintendo Switch",
1269
.vendor_id = 0x0e6f,
1270
.product_id = 0x0180,
1272
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1273
/* SYN, KEY, ABS, MSC */
1275
/* X, Y, Z, RZ, HAT0X, HAT0Y */
1276
.abs = { 0x27, 0x00, 0x03 },
1278
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1279
/* ABC, XYZ, TL, TR, TL2, TR2, SELECT, START, MODE,
1281
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x3f,
1285
.name = "NES Controller (R) NES-style Joycon from Nintendo Online",
1286
.eviocgname = "NES Controller (R)",
1287
/* Joy-Con (L), 0005:057e:2006 v0001, is functionally equivalent.
1288
* Ordinary Joy-Con (R) and NES-style Joy-Con (L) are assumed to be
1289
* functionally equivalent as well. */
1290
.bus_type = 0x0005, /* Bluetooth-only */
1291
.vendor_id = 0x057e,
1292
.product_id = 0x2007,
1294
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1297
/* X, Y, RX, RY, hat 0 */
1298
.abs = { 0x1b, 0x00, 0x03 },
1300
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1301
/* ABC, XYZ, TL, TR, TL2, TR2, SELECT, START, MODE, THUMBL, THUMBR,
1302
* and an unassigned button code */
1303
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0xff,
1307
.name = "Thrustmaster Racing Wheel FFB",
1308
/* Several devices intended for PS4 are functionally equivalent to this:
1309
* https://github.com/ValveSoftware/steam-devices/pull/34
1310
* Mad Catz FightStick TE S+ PS4, 0003:0738:8384:0111 v0111
1311
* (aka Street Fighter V Arcade FightStick TES+)
1312
* Mad Catz FightStick TE2+ PS4, 0003:0738:8481 v0100
1313
* (aka Street Fighter V Arcade FightStick TE2+)
1314
* Bigben Interactive DAIJA Arcade Stick, 0003:146b:0d09 v0111
1315
* (aka Nacon Daija PS4 Arcade Stick)
1316
* Razer Razer Raiju Ultimate Wired, 0003:1532:1009 v0000
1317
* Razer Razer Raiju Ultimate (Bluetooth), 0005:1532:1009 v0001
1320
.vendor_id = 0x044f,
1321
.product_id = 0xb66d,
1323
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1325
/* XYZ, RXYZ, hat 0 */
1326
.abs = { 0x3f, 0x00, 0x03 },
1328
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1329
/* ABC, XYZ, TL, TR, TL2, TR2, SELECT, START, MODE,
1331
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x3f,
1335
.name = "Thrustmaster T.Flight Hotas X",
1337
.vendor_id = 0x044f,
1338
.product_id = 0xb108,
1340
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1342
/* XYZ, RZ, throttle, hat 0 */
1343
.abs = { 0x67, 0x00, 0x03 },
1345
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1346
/* trigger, thumb, thumb2, top, top2, pinkie, base,
1348
/* 0x100 */ ZEROx4, 0xff, 0x0f
1352
.name = "8BitDo N30 Pro via Bluetooth",
1353
/* This device has also been seen reported with an additional
1354
* unassigned button code, the same as the SNES30 v0100 via Bluetooth */
1356
.vendor_id = 0x2dc8,
1357
.product_id = 0x3820,
1359
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1360
/* SYN, KEY, ABS, MSC */
1362
/* XYZ, RZ, gas, brake, hat0 */
1363
.abs = { 0x27, 0x06, 0x03 },
1365
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1366
/* ABC, XYZ, TL, TR, TL2, TR2, select, start, mode, thumbl,
1368
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x7f,
1372
.name = "8BitDo N30 Pro 2 v0111",
1374
.vendor_id = 0x2dc8,
1375
.product_id = 0x9015,
1377
/* 8BitDo NES30 Pro via USB, 0003:2dc8:9001 v0111, is the same;
1378
* but the same physical device via Bluetooth, 0005:2dc8:3820 v0100,
1379
* matches 8BitDo SNES30 v0100 via Bluetooth instead (see above). */
1380
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1382
/* XYZ, RZ, gas, brake, hat0 */
1383
.abs = { 0x27, 0x06, 0x03 },
1385
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1386
/* ABC, XYZ, TL, TR, TL2, TR2, select, start, mode, thumbl,
1388
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x7f,
1392
.name = "8BitDo N30 Pro 2 via Bluetooth",
1393
/* Physically the same device as the one that mimics an Xbox 360
1394
* USB controller when wired */
1396
.vendor_id = 0x045e,
1397
.product_id = 0x02e0,
1399
.expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_HAS_KEYS,
1400
/* SYN, KEY, ABS, MSC, FF */
1401
.ev = { 0x1b, 0x00, 0x20 },
1402
/* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y */
1403
.abs = { 0x3f, 0x00, 0x03 },
1408
/* 0x80 */ 0x00, 0x08, 0x00, 0x00, ZEROx4,
1410
/* ABC, XYZ, TL, TR, TL2, TR2 */
1411
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x03,
1415
.name = "Retro Power SNES-style controller, 0003:0079:0011 v0110",
1417
.vendor_id = 0x0079,
1418
.product_id = 0x0011,
1420
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1425
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1426
/* trigger, thumb, thumb2, top, top2, pinkie, base,
1428
/* 0x100 */ ZEROx4, 0xff, 0x03, 0x00, 0x00,
1432
.name = "Google Stadia Controller rev.A",
1433
.eviocgname = "Google LLC Stadia Controller rev. A",
1434
.usb_vendor_name = "Google LLC",
1435
.usb_product_name = "Stadia Controller rev. A",
1436
/* This data is with USB-C, but the same physical device via Bluetooth,
1437
* 0005:18d1:9400 v0000, is functionally equivalent other than having
1438
* EVIOCGNAME = StadiaXXXX-YYYY where XXXX is the last 4 digits of
1439
* the serial number and YYYY is some other mystery number */
1441
.vendor_id = 0x18d1,
1442
.product_id = 0x9400,
1444
.expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_HAS_KEYS,
1446
/* XYZ, RZ, gas, brake, hat0 */
1447
.abs = { 0x27, 0x06, 0x03 },
1450
/* Volume up/down */
1451
/* 0x40 */ ZEROx4, 0x00, 0x00, 0x0c, 0x00,
1452
/* Media play/pause */
1453
/* 0x80 */ ZEROx4, 0x10, 0x00, 0x00, 0x00,
1455
/* ABXY, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
1456
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
1463
/* TRIGGER_HAPPY 1-4 */
1464
/* 0x2c0 */ 0x0f, 0x00, 0x00, 0x00, ZEROx4,
1468
.name = "Microsoft Xbox Series S|X Controller (model 1914) via USB",
1469
.eviocgname = "Microsoft Xbox Series S|X Controller",
1470
.usb_vendor_name = "Microsoft",
1471
.usb_product_name = "Controller",
1472
/* Physically the same device as 0003:045e:0b13 v0515 below,
1473
* but some functionality is mapped differently */
1475
.vendor_id = 0x045e,
1476
.product_id = 0x0b12,
1478
.expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_HAS_KEYS,
1480
/* X, Y, Z, RX, RY, RZ, hat 0 */
1481
.abs = { 0x3f, 0x00, 0x03 },
1486
/* 0x80 */ ZEROx4, 0x80, 0x00, 0x00, 0x00,
1488
/* ABXY, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */
1489
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c,
1493
.name = "Microsoft Xbox Series S|X Controller (model 1914) via Bluetooth",
1494
.eviocgname = "Xbox Wireless Controller",
1495
/* Physically the same device as 0003:045e:0b12 v050f above,
1496
* but some functionality is mapped differently */
1498
.vendor_id = 0x045e,
1499
.product_id = 0x0b13,
1501
.expected = SDL_UDEV_DEVICE_JOYSTICK | SDL_UDEV_DEVICE_HAS_KEYS,
1503
/* XYZ, RZ, gas, brake, hat0 */
1504
.abs = { 0x27, 0x06, 0x03 },
1509
/* 0x80 */ ZEROx4, 0x80, 0x00, 0x00, 0x00,
1511
/* ABC, XYZ, TL, TR, TL2, TR2, select, start, mode, thumbl,
1513
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xff, 0x7f,
1517
.name = "Wiimote - buttons",
1518
.eviocgname = "Nintendo Wii Remote",
1520
.vendor_id = 0x057e,
1521
.product_id = 0x0306,
1523
/* This one is a bit weird because some of the buttons are mapped
1524
* to the arrow, page up and page down keys, so it's a joystick
1525
* with a subset of a keyboard attached. */
1526
/* TODO: Should this be JOYSTICK, or even JOYSTICK|HAS_KEYS? */
1527
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1529
.ev = { 0x03, 0x00, 0x20 },
1532
/* left, right, up down */
1533
/* 0x40 */ ZEROx4, 0x80, 0x16, 0x00, 0x00,
1536
/* BTN_1, BTN_2, BTN_A, BTN_B, BTN_MODE */
1537
/* 0x100 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x10,
1539
/* next (keyboard page down), previous (keyboard page up) */
1540
/* 0x180 */ 0x00, 0x00, 0x80, 0x10, ZEROx4,
1544
.name = "Wiimote - accelerometer",
1545
.eviocgname = "Nintendo Wii Remote Accelerometer",
1547
.vendor_id = 0x057e,
1548
.product_id = 0x0306,
1550
.expected = SDL_UDEV_DEVICE_ACCELEROMETER,
1553
/* RX, RY, RZ - even though it would more conventionally be X, Y, Z */
1557
.name = "Wiimote - Motion Plus gyroscope",
1558
.eviocgname = "Nintendo Wii Remote Motion Plus",
1559
/* Note that if we only look at the bus type, vendor, product, version
1560
* and axes, this is indistinguishable from the accelerometer */
1562
.vendor_id = 0x057e,
1563
.product_id = 0x0306,
1565
.expected = SDL_UDEV_DEVICE_ACCELEROMETER,
1572
.name = "Wiimote - IR positioning",
1573
.eviocgname = "Nintendo Wii Remote IR",
1575
.vendor_id = 0x057e,
1576
.product_id = 0x0306,
1578
.expected = SDL_UDEV_DEVICE_UNKNOWN,
1581
/* HAT0X, Y to HAT3X, Y */
1582
.abs = { 0x00, 0x00, 0xff },
1585
.name = "Wiimote - Nunchuck",
1586
.eviocgname = "Nintendo Wii Remote Nunchuk",
1588
.vendor_id = 0x057e,
1589
.product_id = 0x0306,
1591
/* TODO: Should this be JOYSTICK? It has one stick and two buttons */
1592
.expected = SDL_UDEV_DEVICE_UNKNOWN,
1595
/* RX, RY, RZ, hat 0 - even though this is an accelerometer, which
1596
* would more conventionally be X, Y, Z, and a left joystick, which
1597
* would more conventionally be X, Y */
1598
.abs = { 0x38, 0x00, 0x03 },
1600
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1601
/* C and Z buttons */
1602
/* 0x100 */ ZEROx4, 0x00, 0x00, 0x24, 0x00,
1606
.name = "Wiimote - Classic Controller",
1607
.eviocgname = "Nintendo Wii Remote Classic Controller",
1609
.vendor_id = 0x057e,
1610
.product_id = 0x0306,
1612
/* TODO: Should this be JOYSTICK, or maybe JOYSTICK|HAS_KEYS?
1613
* It's unusual in the same ways as the Wiimote */
1614
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1617
/* Hat 1-3 X and Y */
1618
.abs = { 0x00, 0x00, 0xfc },
1621
/* left, right, up down */
1622
/* 0x40 */ ZEROx4, 0x80, 0x16, 0x00, 0x00,
1625
/* A, B, X, Y, MODE, TL, TL2, TR, TR2 */
1626
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x13,
1628
/* next (keyboard page down), previous (keyboard page up) */
1629
/* 0x180 */ 0x00, 0x00, 0x80, 0x10, ZEROx4,
1633
/* Flags guessed from kernel source code, not confirmed with real
1635
.name = "Wiimote - Balance Board",
1636
/* TODO: Should this be JOYSTICK? */
1637
.expected = SDL_UDEV_DEVICE_UNKNOWN,
1641
.abs = { 0x00, 0x00, 0x0f },
1643
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1645
/* 0x100 */ ZEROx4, 0x00, 0x00, 0x01, 0x00,
1649
/* Flags guessed from kernel source code, not confirmed with real
1651
.name = "Wiimote - Wii U Pro Controller",
1652
.expected = SDL_UDEV_DEVICE_JOYSTICK,
1658
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1659
/* A, B, X, Y, TL, TR, TL2, TR2, SELECT, START, MODE,
1661
/* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7f,
1666
/* 0x200 */ ZEROx4, 0x0f, 0x00, 0x00, 0x00,
1670
.name = "Synaptics TM3381-002 (Thinkpad X280 trackpad)",
1671
.eviocgname = "Synaptics TM3381-002",
1672
.bus_type = 0x001d, /* BUS_RMI */
1673
.vendor_id = 0x06cb,
1674
.product_id = 0x0000,
1676
.expected = SDL_UDEV_DEVICE_TOUCHPAD,
1679
/* X, Y, pressure, multitouch */
1680
.abs = { 0x03, 0x00, 0x00, 0x01, 0x00, 0x80, 0xf3, 0x06 },
1682
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1683
/* Left mouse button */
1684
/* 0x100 */ 0x00, 0x00, 0x01, 0x00, ZEROx4,
1685
/* BTN_TOOL_FINGER and some multitouch gestures */
1686
/* 0x140 */ 0x20, 0xe5
1688
/* POINTER, BUTTONPAD */
1692
.name = "DELL08AF:00 (Dell XPS laptop touchpad)",
1695
.product_id = 0x76af,
1698
.expected = SDL_UDEV_DEVICE_TOUCHPAD,
1699
/* X, Y, multitouch */
1700
.abs = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x02 },
1702
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1703
/* Left mouse button */
1704
/* 0x100 */ 0x00, 0x00, 0x01, 0x00, ZEROx4,
1705
/* BTN_TOOL_FINGER and some multitouch gestures */
1706
/* 0x140 */ 0x20, 0xe5
1708
/* POINTER, BUTTONPAD */
1712
.name = "TPPS/2 Elan TrackPoint (Thinkpad X280)",
1713
.eviocgname = "TPPS/2 Elan TrackPoint",
1714
.bus_type = 0x0011, /* BUS_I8042 */
1715
.vendor_id = 0x0002,
1716
.product_id = 0x000a,
1718
.expected = SDL_UDEV_DEVICE_MOUSE,
1724
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
1725
/* Left, middle, right mouse buttons */
1726
/* 0x100 */ 0x00, 0x00, 0x07,
1728
/* POINTER, POINTING_STICK */
1732
.name = "Thinkpad ACPI buttons",
1733
.eviocgname = "ThinkPad Extra Buttons",
1735
.vendor_id = 0x17aa,
1736
.product_id = 0x5054,
1738
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1739
/* SYN, KEY, MSC, SW */
1743
/* 0x40 */ ZEROx4, 0x00, 0x00, 0x0e, 0x01,
1744
/* 0x80 */ 0x00, 0x50, 0x11, 0x51, 0x00, 0x28, 0x00, 0xc0,
1745
/* 0xc0 */ 0x04, 0x20, 0x10, 0x02, 0x1b, 0x70, 0x01, 0x00,
1747
/* 0x140 */ ZEROx4, 0x00, 0x00, 0x50, 0x00,
1749
/* 0x1c0 */ 0x00, 0x00, 0x04, 0x18, ZEROx4,
1751
/* 0x240 */ 0x40, 0x00, 0x01, 0x00, ZEROx4,
1755
.name = "Thinkpad ACPI buttons (Linux 6.1)",
1756
.eviocgname = "ThinkPad Extra Buttons",
1758
.vendor_id = 0x17aa,
1759
.product_id = 0x5054,
1761
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1762
/* SYN, KEY, MSC, SW */
1766
/* 0x40 */ ZEROx4, 0x00, 0x00, 0x0e, 0x01,
1767
/* 0x80 */ 0x00, 0x50, 0x11, 0x51, 0x00, 0x28, 0x00, 0xc0,
1768
/* 0xc0 */ 0x04, 0x20, 0x10, 0x02, 0x1b, 0x70, 0x01, 0x00,
1770
/* 0x140 */ ZEROx4, 0x00, 0x00, 0x50, 0x00,
1771
/* 0x180 */ ZEROx4, 0x00, 0x00, 0x00, 0x70,
1772
/* 0x1c0 */ 0x00, 0x00, 0x04, 0x18, 0x20, 0x00, 0x00, 0x00,
1778
.name = "PC speaker",
1779
.eviocgname = "PC Speaker",
1780
.bus_type = 0x0010, /* BUS_ISA */
1781
.vendor_id = 0x001f,
1782
.product_id = 0x0001,
1784
.expected = SDL_UDEV_DEVICE_UNKNOWN,
1786
.ev = { 0x01, 0x00, 0x04 },
1789
.name = "HDA Digital PCBeep",
1790
.eviocgname = "HDA Digital PCBeep",
1792
.vendor_id = 0x10ec,
1793
.product_id = 0x0257,
1795
.expected = SDL_UDEV_DEVICE_UNKNOWN,
1797
.ev = { 0x01, 0x00, 0x04 },
1800
.name = "ALSA headphone detection, etc.",
1801
.eviocgname = "HDA Intel PCH Mic",
1802
/* HDA Intel PCH Headphone is functionally equivalent */
1803
/* HDA Intel PCH HDMI/DP,pcm=3 is functionally equivalent */
1804
/* HDA Intel PCH HDMI/DP,pcm=7 is functionally equivalent */
1805
/* HDA Intel PCH HDMI/DP,pcm=8 is functionally equivalent */
1807
.vendor_id = 0x0000,
1808
.product_id = 0x0000,
1810
.expected = SDL_UDEV_DEVICE_UNKNOWN,
1815
/* Assumed to be a reasonably typical i8042 (PC AT) keyboard */
1816
.name = "Thinkpad T520 and X280 keyboards",
1817
/* Steam Deck LCD/OLED keyboard interface is version 0xab83 but
1818
* otherwise equivalent */
1819
.eviocgname = "AT Translated Set 2 keyboard",
1820
.bus_type = 0x0011, /* BUS_I8042 */
1821
.vendor_id = 0x0001,
1822
.product_id = 0x0001,
1824
.expected = SDL_UDEV_DEVICE_HAS_KEYS | SDL_UDEV_DEVICE_KEYBOARD,
1825
/* SYN, KEY, MSC, LED, REP */
1826
.ev = { 0x13, 0x00, 0x12 },
1828
/* 0x00 */ 0xfe, 0xff, 0xff, 0xff, FFx4,
1829
/* 0x40 */ 0xff, 0xff, 0xef, 0xff, 0xdf, 0xff, 0xff, 0xfe,
1830
/* 0x80 */ 0x01, 0xd0, 0x00, 0xf8, 0x78, 0x30, 0x80, 0x03,
1831
/* 0xc0 */ 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00,
1835
.name = "Thinkpad X280 sleep button",
1836
.eviocgname = "Sleep Button",
1837
.bus_type = 0x0019, /* BUS_HOST */
1838
.vendor_id = 0x0000,
1839
.product_id = 0x0003,
1841
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1848
/* 0x80 */ 0x00, 0x40,
1852
/* As seen on Thinkpad X280, Steam Deck LCD, Steam Deck OLED */
1853
.name = "ACPI lid switch",
1854
.eviocgname = "Lid Switch",
1855
.bus_type = 0x0019, /* BUS_HOST */
1856
.vendor_id = 0x0000,
1857
.product_id = 0x0005,
1859
.expected = SDL_UDEV_DEVICE_UNKNOWN,
1864
/* As seen on Thinkpad X280, Steam Deck LCD, Steam Deck OLED */
1865
.name = "ACPI power button",
1866
.eviocgname = "Power Button",
1867
.bus_type = 0x0019, /* BUS_HOST */
1868
.vendor_id = 0x0000,
1869
.product_id = 0x0001,
1871
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1877
/* 0x40 */ ZEROx4, 0x00, 0x00, 0x10, 0x00,
1881
/* As seen on Thinkpad X280, Steam Deck LCD, Steam Deck OLED */
1882
.name = "ACPI video bus",
1883
.eviocgname = "Video Bus",
1884
.bus_type = 0x0019, /* BUS_HOST */
1885
.vendor_id = 0x0000,
1886
.product_id = 0x0006,
1888
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1895
/* brightness control, video mode, display off */
1896
/* 0xc0 */ ZEROx4, 0x0b, 0x00, 0x3e, 0x00,
1900
.name = "Thinkpad X280 webcam",
1901
.eviocgname = "Integrated Camera: Integrated C",
1902
.usb_vendor_name = "Chicony Electronics Co.,Ltd.",
1903
.usb_product_name = "Integrated Camera",
1905
.vendor_id = 0x04f2,
1906
.product_id = 0xb604,
1908
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1916
/* 0xc0 */ 0x00, 0x00, 0x10, 0x00, ZEROx4,
1920
.name = "Thinkpad X280 extra buttons",
1921
.bus_type = 0x0019, /* BUS_HOST */
1922
.vendor_id = 0x17aa,
1923
.product_id = 0x5054,
1925
.expected = SDL_UDEV_DEVICE_HAS_KEYS,
1930
/* 0x40 */ ZEROx4, 0x00, 0x00, 0x0e, 0x01,
1931
/* 0x80 */ 0x00, 0x50, 0x11, 0x51, 0x00, 0x28, 0x00, 0xc0,
1932
/* 0xc0 */ 0x04, 0x20, 0x10, 0x02, 0x1b, 0x70, 0x01, 0x00,
1934
/* 0x140 */ ZEROx4, 0x00, 0x00, 0x50, 0x00,
1936
/* 0x1c0 */ 0x00, 0x00, 0x04, 0x18, ZEROx4,
1938
/* 0x240 */ 0x40, 0x00, 0x01, 0x00, ZEROx4,
1942
.name = "Thinkpad USB keyboard with Trackpoint - keyboard",
1943
.eviocgname = "Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint",
1944
.usb_vendor_name = "Lite-On Technology Corp.",
1945
.usb_product_name = "ThinkPad USB Keyboard with TrackPoint",
1947
.vendor_id = 0x17ef,
1948
.product_id = 0x6009,
1949
.expected = SDL_UDEV_DEVICE_HAS_KEYS | SDL_UDEV_DEVICE_KEYBOARD,
1950
/* SYN, KEY, MSC, LED, REP */
1951
.ev = { 0x13, 0x00, 0x12 },
1953
/* 0x00 */ 0xfe, 0xff, 0xff, 0xff, FFx4,
1954
/* 0x40 */ 0xff, 0xff, 0xef, 0xff, 0xdf, 0xff, 0xbe, 0xfe,
1955
/* 0x80 */ 0xff, 0x57, 0x40, 0xc1, 0x7a, 0x20, 0x9f, 0xff,
1956
/* 0xc0 */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
1958
.hid_report_descriptor_length = sizeof (thinkpad_usb_keyboard_hid_report_descriptor),
1959
.hid_report_descriptor = &thinkpad_usb_keyboard_hid_report_descriptor[0],
1962
.name = "Thinkpad USB keyboard with Trackpoint - Trackpoint",
1963
.eviocgname = "Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint",
1964
.usb_vendor_name = "Lite-On Technology Corp.",
1965
.usb_product_name = "ThinkPad USB Keyboard with TrackPoint",
1967
.vendor_id = 0x17ef,
1968
.product_id = 0x6009,
1970
/* For some reason the special keys like mute and wlan toggle
1971
* show up here instead of, or in addition to, as part of
1972
* the keyboard - so both udev and SDL report this as having keys too. */
1973
.expected = SDL_UDEV_DEVICE_MOUSE | SDL_UDEV_DEVICE_HAS_KEYS,
1974
/* SYN, KEY, REL, MSC, LED */
1975
.ev = { 0x17, 0x00, 0x02 },
1980
/* 0x40 */ ZEROx4, 0x00, 0x00, 0x1e, 0x00,
1981
/* 0x80 */ 0x00, 0xcc, 0x11, 0x01, 0x78, 0x40, 0x00, 0xc0,
1982
/* 0xc0 */ 0x00, 0x20, 0x10, 0x00, 0x0b, 0x50, 0x00, 0x00,
1983
/* Mouse buttons: left, right, middle, "task" */
1984
/* 0x100 */ 0x00, 0x00, 0x87, 0x68, ZEROx4,
1985
/* 0x140 */ ZEROx4, 0x00, 0x00, 0x10, 0x00,
1986
/* 0x180 */ ZEROx4, 0x00, 0x00, 0x40, 0x00,
1988
.hid_report_descriptor_length = sizeof (thinkpad_usb_trackpoint_hid_report_descriptor),
1989
.hid_report_descriptor = &thinkpad_usb_trackpoint_hid_report_descriptor[0],
1991
{ /* https://github.com/ValveSoftware/Proton/issues/5126 */
1992
.name = "Smarty Co. VRS DirectForce Pro Pedals",
1994
.vendor_id = 0x0483, /* STMicroelectronics */
1995
.product_id = 0xa3be, /* VRS DirectForce Pro Pedals */
1997
/* TODO: Ideally we would identify this as a joystick, but there
1998
* isn't currently enough information to do that without a table
1999
* of known devices. */
2000
.expected = SDL_UDEV_DEVICE_JOYSTICK,
2001
.todo = "https://github.com/ValveSoftware/Proton/issues/5126",
2006
.hid_report_descriptor_length = sizeof (vrs_pedals_hid_report_descriptor),
2007
.hid_report_descriptor = &vrs_pedals_hid_report_descriptor[0],
2009
{ /* https://github.com/ValveSoftware/Proton/issues/5126 */
2010
.name = "Heusinkveld Heusinkveld Sim Pedals Ultimate",
2012
.vendor_id = 0x30b7, /* Heusinkveld Engineering */
2013
.product_id = 0x1003, /* Heusinkveld Sim Pedals Ultimate */
2015
/* TODO: Ideally we would identify this as a joystick, but there
2016
* isn't currently enough information to do that without a table
2017
* of known devices. */
2018
.expected = SDL_UDEV_DEVICE_JOYSTICK,
2019
.todo = "https://github.com/ValveSoftware/Proton/issues/5126",
2024
.hid_report_descriptor_length = sizeof (heusinkveld_pedals_hid_report_descriptor),
2025
.hid_report_descriptor = &heusinkveld_pedals_hid_report_descriptor[0],
2027
{ /* https://github.com/ValveSoftware/Proton/issues/5126 */
2028
.name = "Vitaly [mega_mozg] Naidentsev ODDOR-handbrake",
2030
.vendor_id = 0x0000,
2031
.product_id = 0x0000,
2033
/* TODO: Ideally we would identify this as a joystick by it having
2034
* the joystick-specific THROTTLE axis and TRIGGER/THUMB buttons */
2035
.expected = SDL_UDEV_DEVICE_JOYSTICK,
2036
.todo = "https://github.com/ValveSoftware/Proton/issues/5126",
2037
/* SYN, KEY, ABS, MSC */
2042
/* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8,
2043
/* TRIGGER = 0x120, THUMB = 0x121 */
2044
/* 0x100 */ ZEROx4, 0x03, 0x00, 0x00, 0x00,
2047
{ /* https://github.com/ValveSoftware/Proton/issues/5126 */
2048
.name = "Leo Bodnar Logitech® G25 Pedals",
2050
.vendor_id = 0x1dd2, /* Leo Bodnar Electronics Ltd */
2051
.product_id = 0x100c,
2053
/* TODO: Ideally we would identify this as a joystick, but there
2054
* isn't currently enough information to do that without a table
2055
* of known devices. */
2056
.expected = SDL_UDEV_DEVICE_JOYSTICK,
2057
.todo = "https://github.com/ValveSoftware/Proton/issues/5126",
2063
{ /* https://github.com/ValveSoftware/Proton/issues/5126 */
2064
.name = "FANATEC ClubSport USB Handbrake",
2066
.vendor_id = 0x0eb7,
2067
.product_id = 0x1a93,
2069
/* TODO: Ideally we would identify this as a joystick, but there
2070
* isn't currently enough information to do that without a table
2071
* of known devices. */
2072
.expected = SDL_UDEV_DEVICE_JOYSTICK,
2073
.todo = "https://github.com/ValveSoftware/Proton/issues/5126",
2078
.hid_report_descriptor_length = sizeof (fanatec_handbrake_hid_report_descriptor),
2079
.hid_report_descriptor = &fanatec_handbrake_hid_report_descriptor[0],
2081
{ /* Artificial test data, not a real device */
2082
.name = "Fake accelerometer with fewer than usual axes reported",
2083
.expected = SDL_UDEV_DEVICE_ACCELEROMETER,
2091
{ /* Artificial test data, not a real device */
2092
.name = "Fake pointing stick with no buttons",
2093
.expected = SDL_UDEV_DEVICE_MOUSE,
2098
/* POINTER, POINTING_STICK */
2101
{ /* Artificial test data, not a real device */
2102
.name = "Fake buttonpad",
2103
.expected = SDL_UDEV_DEVICE_TOUCHPAD,
2108
/* POINTER, BUTTONPAD */
2112
.name = "No information",
2113
.expected = SDL_UDEV_DEVICE_UNKNOWN,
2116
/* *INDENT-ON* */ /* clang-format on */
2118
/* The Linux kernel provides capability info in EVIOCGBIT and in /sys
2119
* as an array of unsigned long in native byte order, rather than an array
2120
* of bytes, an array of native-endian 32-bit words or an array of
2121
* native-endian 64-bit words like you might have reasonably expected.
2122
* The order of words in the array is always lowest-valued first: for
2123
* instance, the first unsigned long in abs[] contains the bit representing
2124
* absolute axis 0 (ABS_X).
2126
* The constant arrays above provide test data in little-endian, because
2127
* that's the easiest representation for hard-coding into a test like this.
2128
* On a big-endian platform we need to byteswap it, one unsigned long at a
2129
* time, to match what the kernel would produce. This requires us to choose
2130
* an appropriate byteswapping function for the architecture's word size. */
2131
SDL_COMPILE_TIME_ASSERT(sizeof_long, sizeof(unsigned long) == 4 || sizeof(unsigned long) == 8);
2132
#define SwapLongLE(X) \
2133
((sizeof(unsigned long) == 4) ? SDL_Swap32LE(X) : SDL_Swap64LE(X))
2141
for (i = 0; i < SDL_arraysize(guess_tests); i++) {
2142
const GuessTest *t = &guess_tests[i];
2147
unsigned long props[NBITS(INPUT_PROP_MAX)];
2148
unsigned long ev[NBITS(EV_MAX)];
2149
unsigned long abs[NBITS(ABS_MAX)];
2150
unsigned long keys[NBITS(KEY_MAX)];
2151
unsigned long rel[NBITS(REL_MAX)];
2154
printf("%s...\n", t->name);
2156
SDL_memset(&caps, '\0', sizeof(caps));
2157
SDL_memcpy(caps.props, t->props, sizeof(t->props));
2158
SDL_memcpy(caps.ev, t->ev, sizeof(t->ev));
2159
SDL_memcpy(caps.keys, t->keys, sizeof(t->keys));
2160
SDL_memcpy(caps.abs, t->abs, sizeof(t->abs));
2161
SDL_memcpy(caps.rel, t->rel, sizeof(t->rel));
2163
for (j = 0; j < SDL_arraysize(caps.props); j++) {
2164
caps.props[j] = SwapLongLE(caps.props[j]);
2167
for (j = 0; j < SDL_arraysize(caps.ev); j++) {
2168
caps.ev[j] = SwapLongLE(caps.ev[j]);
2171
for (j = 0; j < SDL_arraysize(caps.keys); j++) {
2172
caps.keys[j] = SwapLongLE(caps.keys[j]);
2175
for (j = 0; j < SDL_arraysize(caps.abs); j++) {
2176
caps.abs[j] = SwapLongLE(caps.abs[j]);
2179
for (j = 0; j < SDL_arraysize(caps.rel); j++) {
2180
caps.rel[j] = SwapLongLE(caps.rel[j]);
2183
actual = SDL_EVDEV_GuessDeviceClass(caps.props, caps.ev, caps.abs,
2184
caps.keys, caps.rel);
2186
if (actual == t->expected) {
2189
printf("\tExpected 0x%08x\n", t->expected);
2191
for (j = 0; device_classes[j].code != 0; j++) {
2192
if (t->expected & device_classes[j].code) {
2193
printf("\t\t%s\n", device_classes[j].name);
2197
printf("\tGot 0x%08x\n", actual);
2199
for (j = 0; device_classes[j].code != 0; j++) {
2200
if (actual & device_classes[j].code) {
2201
printf("\t\t%s\n", device_classes[j].name);
2206
printf("\tKnown issue, ignoring: %s\n", t->todo);
2208
printf("\tFailed\n");
2217
#else /* !(HAVE_LIBUDEV_H || defined(SDL_JOYSTICK_LINUX)) */
2222
printf("SDL compiled without evdev capability check.\n");
2228
int main(int argc, char *argv[])
2231
SDLTest_CommonState *state;
2233
/* Initialize test framework */
2234
state = SDLTest_CommonCreateState(argv, 0);
2239
/* Parse commandline */
2240
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
2244
result = run_test() ? 0 : 1;
2247
SDLTest_CommonDestroyState(state);