mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 17:01:24 +12:00
Fix evdev joystick detection
This commit is contained in:
parent
514a98321d
commit
e6a07e80d7
2 changed files with 4 additions and 3 deletions
|
@ -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));
|
LOG_WARNING(GENERAL, "Failed to connect to device at %s, the error was: %s", "/dev/input/" + et.name, strerror(-rc));
|
||||||
continue;
|
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));
|
joy_paths.emplace_back(fmt::format("/dev/input/%s", et.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#define JOYSTICK_BUSTYPE 3
|
|
||||||
|
|
||||||
enum { EVDEV_DPAD_HAT_AXIS_X = -1, EVDEV_DPAD_HAT_AXIS_Y = -2 };
|
enum { EVDEV_DPAD_HAT_AXIS_X = -1, EVDEV_DPAD_HAT_AXIS_Y = -2 };
|
||||||
|
|
||||||
struct evdev_joystick_config final : cfg::node
|
struct evdev_joystick_config final : cfg::node
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue