evdev: Search for libevdev.so.2 first

Many Linux distributions provide livevdev.so.2 only so check that first.
This commit is contained in:
Christoph "baka0815" Schwerdtfeger 2018-08-27 09:53:54 +02:00
parent fb4b5de863
commit 1d66d1e2da
1 changed files with 4 additions and 4 deletions

View File

@ -21,12 +21,12 @@
void load_libevdev()
{
if (libevdev_tried)
{
return;
}
libevdev_tried = true;
void* lib_handle = dlopen("libevdev.so", RTLD_NOW);
void* lib_handle = dlopen("libevdev.so.2", RTLD_NOW);
if (!lib_handle) // libevdev.so.2 not found, fallback to libevdev.so
lib_handle = dlopen("libevdev.so", RTLD_NOW);
bool failed = false;
@ -56,7 +56,7 @@
}
}
if(failed)
if (failed)
{
puts("WARNING: libevdev is not available. You'll not be able to use button names instead of numeric codes in your controller mappings!\n");
return;