Recheck through gamepads when gamepad is added or removed (#546)

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

* 🚑️ fix: oops i forgot to put lego1_export
This commit is contained in:
Helloyunho 2025-07-07 11:36:37 +09:00 committed by GitHub
parent bb86ee3172
commit b82cfc4b36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

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

View File

@ -108,7 +108,7 @@ public:
MxResult Create(HWND p_hwnd);
void Destroy() override;
MxResult GetJoystick();
LEGO1_EXPORT MxResult GetJoystick();
MxResult GetJoystickState(MxU32* p_joystickX, MxU32* p_joystickY, MxU32* p_povPosition);
void StartAutoDragTimer();
void StopAutoDragTimer();