diff --git a/rpcs3/evdev_joystick_handler.cpp b/rpcs3/evdev_joystick_handler.cpp index 097b013988..d1792395f2 100644 --- a/rpcs3/evdev_joystick_handler.cpp +++ b/rpcs3/evdev_joystick_handler.cpp @@ -59,8 +59,11 @@ void evdev_joystick_handler::Init(const u32 max_connect) LOG_WARNING(GENERAL, "Failed to connect to device at %s, the error was: %s", "/dev/input/" + et.name, strerror(-rc)); continue; } - if (libevdev_get_id_bustype(dev) == JOYSTICK_BUSTYPE) + if (libevdev_has_event_type(dev, EV_KEY) && + libevdev_has_event_code(dev, EV_ABS, ABS_X) && + libevdev_has_event_code(dev, EV_ABS, ABS_Y)) { + // It's a joystick. joy_paths.emplace_back(fmt::format("/dev/input/%s", et.name)); } } diff --git a/rpcs3/evdev_joystick_handler.h b/rpcs3/evdev_joystick_handler.h index 41026bdda9..5737be6f68 100644 --- a/rpcs3/evdev_joystick_handler.h +++ b/rpcs3/evdev_joystick_handler.h @@ -8,8 +8,6 @@ #include #include -#define JOYSTICK_BUSTYPE 3 - enum { EVDEV_DPAD_HAT_AXIS_X = -1, EVDEV_DPAD_HAT_AXIS_Y = -2 }; struct evdev_joystick_config final : cfg::node