enum evdev_device_udev_tags udev_tags;
bool has_joystick_tags;
struct libevdev *evdev = device->evdev;
- unsigned int code, num_joystick_btns = 0, num_keys = 0;
+ unsigned int code;
/* The EVDEV_UDEV_TAG_JOYSTICK is set when a joystick or gamepad button
* is found. However, it can not be used to identify joysticks or
if (num_well_known_keys >= 4) /* should not have 4 well-known keys */
return false;
+ unsigned int num_joystick_btns = 0;
+
for (code = BTN_JOYSTICK; code < BTN_DIGI; code++) {
if (libevdev_has_event_code(evdev, EV_KEY, code))
num_joystick_btns++;
if (num_joystick_btns < 2) /* require at least 2 joystick buttons */
return false;
+ unsigned int num_keys = 0;
for (code = KEY_ESC; code <= KEY_MICMUTE; code++) {
if (libevdev_has_event_code(evdev, EV_KEY, code) )