sdl_gamepad: fix button detection on modern controllers

Needed to get the Xbox Series X Controller working fully.
This commit is contained in:
DeadSix27 2023-09-20 21:01:53 +02:00 committed by Dudemanguy
parent f4de509f01
commit b41bd5a8f0
1 changed files with 2 additions and 0 deletions

View File

@ -198,6 +198,8 @@ static void remove_gamepad(struct mp_input_src *src, int id)
static void read_gamepad_thread(struct mp_input_src *src, void *param) static void read_gamepad_thread(struct mp_input_src *src, void *param)
{ {
SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1");
if (SDL_WasInit(SDL_INIT_EVENTS)) { if (SDL_WasInit(SDL_INIT_EVENTS)) {
MP_ERR(src, "Another component is using SDL already.\n"); MP_ERR(src, "Another component is using SDL already.\n");
mp_input_src_init_done(src); mp_input_src_init_done(src);