From 8cf430ef7e7bd71aedd16ad0588c8f425be3348a Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Fri, 25 Nov 2022 20:43:48 -0600 Subject: [PATCH] SDLInputSource: Custom hint support --- pcsx2/Frontend/SDLInputSource.cpp | 4 ++++ pcsx2/Frontend/SDLInputSource.h | 1 + 2 files changed, 5 insertions(+) diff --git a/pcsx2/Frontend/SDLInputSource.cpp b/pcsx2/Frontend/SDLInputSource.cpp index 5d9e9ec6ff..0f687df728 100644 --- a/pcsx2/Frontend/SDLInputSource.cpp +++ b/pcsx2/Frontend/SDLInputSource.cpp @@ -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& hint : m_sdl_hints) + SDL_SetHint(hint.first.c_str(), hint.second.c_str()); } bool SDLInputSource::InitializeSubsystem() diff --git a/pcsx2/Frontend/SDLInputSource.h b/pcsx2/Frontend/SDLInputSource.h index a4b4a9378c..02ef309292 100644 --- a/pcsx2/Frontend/SDLInputSource.h +++ b/pcsx2/Frontend/SDLInputSource.h @@ -92,4 +92,5 @@ private: bool m_sdl_subsystem_initialized = false; bool m_controller_enhanced_mode = false; + std::vector> m_sdl_hints; };