Skip to content

Commit 3bbbeca

Browse files
committed
Save fallback to linuxraw driver in case of first boot.
When no devices can be detected and it is the initial boot, make sure the driver is set to linuxraw, if supported.
1 parent 1b3973e commit 3bbbeca

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

input/drivers/udev_input.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4126,7 +4126,28 @@ static void *udev_input_init(const char *joypad_driver)
41264126
/* If using KMS and we forgot this,
41274127
* we could lock ourselves out completely. */
41284128
if (!udev->num_devices)
4129+
{
4130+
settings_t *settings = config_get_ptr();
41294131
RARCH_WARN("[udev]: Couldn't open any keyboard, mouse or touchpad. Are permissions set correctly for /dev/input/event* and /run/udev/?\n");
4132+
/* Start screen is not used nowadays, but it still gets true value only
4133+
* on first startup without config file, so it should be good to catch
4134+
* initial boots without udev devices available. */
4135+
#if defined(__linux__) && !defined(ANDROID)
4136+
if (settings->bools.menu_show_start_screen)
4137+
{
4138+
/* Force fallback to linuxraw. Driver reselection would happen even
4139+
* without overwriting input_driver setting, but that would not be saved
4140+
* as input driver auto-changes are not stored (due to interlock with
4141+
* video context driver), and on next boot user would be stuck with a
4142+
* possibly nonworking configuration.
4143+
*/
4144+
strlcpy(settings->arrays.input_driver, "linuxraw",
4145+
sizeof(settings->arrays.input_driver));
4146+
RARCH_WARN("[udev]: First boot and without input devices, forcing fallback to linuxraw.\n");
4147+
goto error;
4148+
}
4149+
#endif
4150+
}
41304151

41314152
input_keymaps_init_keyboard_lut(rarch_key_map_linux);
41324153

0 commit comments

Comments
 (0)