File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Source/Core/InputCommon/ControllerInterface/SDL Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1818#include " Common/ScopeGuard.h"
1919#include " Common/Thread.h"
2020
21+ #include " Core/Config/MainSettings.h"
22+ #include " Core/HW/SI/SI.h"
23+ #include " Core/HW/SI/SI_Device.h"
24+
2125#include " InputCommon/ControllerInterface/ControllerInterface.h"
2226#include " InputCommon/ControllerInterface/SDL/SDLGamepad.h"
2327
@@ -145,6 +149,21 @@ InputBackend::InputBackend(ControllerInterface* controller_interface)
145149 // call within SDL.
146150 SDL_SetHint (SDL_HINT_JOYSTICK_DIRECTINPUT, " 0" );
147151
152+ // Disable SDL's GC Adapter handling when we want to handle it ourselves.
153+ bool is_gc_adapter_configured = false ;
154+ for (int i = 0 ; i != SerialInterface::MAX_SI_CHANNELS; ++i)
155+ {
156+ if (Config::Get (Config::GetInfoForSIDevice (i)) == SerialInterface::SIDEVICE_WIIU_ADAPTER)
157+ {
158+ is_gc_adapter_configured = true ;
159+ break ;
160+ }
161+ }
162+ // TODO: This hint should be adjusted when the config changes,
163+ // but SDL requires it be set before joystick initialization,
164+ // and ControllerInterface isn't prepared for SDL to spontaneously re-initialize itself.
165+ SDL_SetHint (SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, is_gc_adapter_configured ? " 0" : " 1" );
166+
148167 m_hotplug_thread = std::thread ([this ] {
149168 Common::SetCurrentThreadName (" SDL Hotplug Thread" );
150169
You can’t perform that action at this time.
0 commit comments