🩹 fix: recheck through gamepads when gamepad is added or removed

This commit is contained in:
Helloyunho 2025-07-07 11:14:33 +09:00
parent bb86ee3172
commit c47658a8ef
No known key found for this signature in database
GPG Key ID: 6AFA210B0150BE47

View File

@ -474,6 +474,13 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
} }
break; break;
} }
case SDL_EVENT_GAMEPAD_ADDED:
case SDL_EVENT_GAMEPAD_REMOVED: {
if (InputManager()) {
InputManager()->GetJoystick();
}
break;
}
case SDL_EVENT_GAMEPAD_BUTTON_DOWN: { case SDL_EVENT_GAMEPAD_BUTTON_DOWN: {
switch (event->gbutton.button) { switch (event->gbutton.button) {
case SDL_GAMEPAD_BUTTON_DPAD_UP: case SDL_GAMEPAD_BUTTON_DPAD_UP: