Skip to content

Commit

Permalink
Do not use UDEV references in EVDEV if UDEV has not been detected
Browse files Browse the repository at this point in the history
  • Loading branch information
gabomdq committed Sep 28, 2013
1 parent 99789c7 commit 1ccbad9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/input/evdev/SDL_evdev.c
Expand Up @@ -53,12 +53,14 @@ static _THIS = NULL;
#define SYN_DROPPED 3
#endif

static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode);
static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item);

#if SDL_USE_LIBUDEV
static int SDL_EVDEV_device_removed(const char *devpath);
static int SDL_EVDEV_device_added(const SDL_UDEV_deviceclass devclass, const char *devpath);
static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode);
static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item);
void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, SDL_UDEV_deviceclass udev_class, const char *devpath);
#endif /* SDL_USE_LIBUDEV */

static SDL_Scancode EVDEV_Keycodes[] = {
SDL_SCANCODE_UNKNOWN, /* KEY_RESERVED 0 */
Expand Down Expand Up @@ -390,6 +392,7 @@ SDL_EVDEV_Quit(void)
}
}

#if SDL_USE_LIBUDEV
void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, SDL_UDEV_deviceclass udev_class, const char *devpath)
{
SDL_EVDEV_deviceclass devclass;
Expand Down Expand Up @@ -429,6 +432,8 @@ void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, SDL_UDEV_deviceclas

}

#endif /* SDL_USE_LIBUDEV */

void
SDL_EVDEV_Poll(void)
{
Expand Down Expand Up @@ -562,6 +567,7 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
/* TODO: get full state of device and report whatever is required */
}

#if SDL_USE_LIBUDEV
static int
SDL_EVDEV_device_added(const SDL_UDEV_deviceclass devclass, const char *devpath)
{
Expand Down Expand Up @@ -640,6 +646,7 @@ SDL_EVDEV_device_removed(const char *devpath)

return -1;
}
#endif /* SDL_USE_LIBUDEV */

#endif /* SDL_INPUT_LINUXEV */

Expand Down

0 comments on commit 1ccbad9

Please sign in to comment.