mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Merge pull request #8897 from orbea/khr
Try using the udev or linuxraw input drivers for khr_display.
This commit is contained in:
commit
cc22680480
@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
@ -154,9 +155,42 @@ error:
|
||||
}
|
||||
|
||||
static void gfx_ctx_khr_display_input_driver(void *data,
|
||||
const char *name,
|
||||
const char *joypad_name,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
#ifdef HAVE_X11
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
/* We cannot use the X11 input driver for DRM/KMS */
|
||||
if (string_is_equal(settings->arrays.input_driver, "x"))
|
||||
{
|
||||
#ifdef HAVE_UDEV
|
||||
{
|
||||
/* Try to set it to udev instead */
|
||||
void *udev = input_udev.init(joypad_name);
|
||||
if (udev)
|
||||
{
|
||||
*input = &input_udev;
|
||||
*input_data = udev;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
{
|
||||
/* Try to set it to linuxraw instead */
|
||||
void *linuxraw = input_linuxraw.init(joypad_name);
|
||||
if (linuxraw)
|
||||
{
|
||||
*input = &input_linuxraw;
|
||||
*input_data = linuxraw;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
*input = NULL;
|
||||
*input_data = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user