SDLInputSource: Custom hint support

This commit is contained in:
TellowKrinkle 2022-11-25 20:43:48 -06:00 committed by refractionpcsx2
parent e2c3a8b1e1
commit 8cf430ef7e
2 changed files with 5 additions and 0 deletions

View File

@ -158,6 +158,7 @@ void SDLInputSource::Shutdown()
void SDLInputSource::LoadSettings(SettingsInterface& si)
{
m_controller_enhanced_mode = si.GetBoolValue("InputSources", "SDLControllerEnhancedMode", false);
m_sdl_hints = si.GetKeyValueList("SDLHints");
}
void SDLInputSource::SetHints()
@ -173,6 +174,9 @@ void SDLInputSource::SetHints()
// New as of SDL 2.26, so use string
SDL_SetHint("SDL_JOYSTICK_HIDAPI_PS3", "1");
#endif
for (const std::pair<std::string, std::string>& hint : m_sdl_hints)
SDL_SetHint(hint.first.c_str(), hint.second.c_str());
}
bool SDLInputSource::InitializeSubsystem()

View File

@ -92,4 +92,5 @@ private:
bool m_sdl_subsystem_initialized = false;
bool m_controller_enhanced_mode = false;
std::vector<std::pair<std::string, std::string>> m_sdl_hints;
};