Pad: Fix connection of macOS GameController framework controllers

This commit is contained in:
TellowKrinkle 2021-12-12 05:00:16 -06:00 committed by lightningterror
parent a12ad1f627
commit 1beb5517a7
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,10 @@
#endif
#endif // __WXGTK__
#ifdef SDL_BUILD
#include <SDL.h>
#endif
using namespace pxSizerFlags;
void Pcsx2App::DetectCpuAndUserMode()
@ -505,6 +509,12 @@ bool Pcsx2App::OnInit()
CleanupOnExit();
return false;
}
#ifdef SDL_BUILD
// MacOS Game Controller framework requires a few runs of the main event loop after interest in game controllers is first indicated to connect controllers
// Since OnePad doesn't currently handle connection/disconnection events and requires controllers to be connected on start, we need to initialize SDL before OnePad looks at the controller list
SDL_Init(SDL_INIT_GAMECONTROLLER);
#endif
return true;
}