Fixed bug where a Logitech wireless keyboard with built-in mouse touchpad didn't get recongized as both devices.

This commit is contained in:
Sam Lantinga 2013-10-05 21:15:55 -07:00
parent 583198f72e
commit 5c03a1488f
5 changed files with 134 additions and 188 deletions

View file

@ -57,7 +57,7 @@
static int MaybeAddDevice(const char *path);
#if SDL_USE_LIBUDEV
static int MaybeRemoveDevice(const char *path);
void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, SDL_UDEV_deviceclass udev_class, const char *devpath);
void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath);
#endif /* SDL_USE_LIBUDEV */
@ -136,11 +136,11 @@ IsJoystick(int fd, char *namebuf, const size_t namebuflen, SDL_JoystickGUID *gui
}
#if SDL_USE_LIBUDEV
void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, SDL_UDEV_deviceclass udev_class, const char *devpath)
void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath)
{
int instance;
if (devpath == NULL || udev_class != SDL_UDEV_DEVICE_JOYSTICK) {
if (devpath == NULL || !(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) {
return;
}