From 33f9030d0d3aec2d956bfd8faadfee09bc8285da Mon Sep 17 00:00:00 2001 From: dreamsyntax Date: Tue, 27 Feb 2024 13:18:13 -0700 Subject: [PATCH] push before testing with QtCreator platform swap (to be squashed) --- pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp | 1 + pcsx2/ImGui/FullscreenUI.cpp | 3 +++ pcsx2/Input/SDLInputSource.cpp | 5 ++++- pcsx2/Input/SDLInputSource.h | 1 + pcsx2/SIO/Pad/Pad.cpp | 2 ++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp index b091b3c0e4b15b..c75125c60c9b75 100644 --- a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp +++ b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp @@ -20,6 +20,7 @@ ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableSDLSource, "InputSources", "SDL", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableSDLEnhancedMode, "InputSources", "SDLControllerEnhancedMode", false); + SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableSDLPS5PlayerLED, "InputSources", "SDLPS5PlayerLED", false); connect(m_ui.enableSDLSource, &QCheckBox::stateChanged, this, &ControllerGlobalSettingsWidget::updateSDLOptionsEnabled); connect(m_ui.ledSettings, &QToolButton::clicked, this, &ControllerGlobalSettingsWidget::ledSettingsClicked); diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index 7a900b47088e0c..891f9a5c8ec643 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -3916,6 +3916,9 @@ void FullscreenUI::DrawControllerSettingsPage() DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_WIFI, "SDL DualShock 4 / DualSense Enhanced Mode"), FSUI_CSTR("Provides vibration and LED control support over Bluetooth."), "InputSources", "SDLControllerEnhancedMode", false, bsi->GetBoolValue("InputSources", "SDL", true), false); + DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_LIGHTBULB, "SDL DualSense Player LED"), + FSUI_CSTR("Enable/Disable the Player LED on DualSense controllers."), "InputSources", "SDLPS5PlayerLED", false, + bsi->GetBoolValue("InputSources", "SDLControllerEnhancedMode", true), false); #ifdef _WIN32 DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_COG, "SDL Raw Input"), FSUI_CSTR("Allow SDL to use raw access to input devices."), "InputSources", "SDLRawInput", false, bsi->GetBoolValue("InputSources", "SDL", true), false); diff --git a/pcsx2/Input/SDLInputSource.cpp b/pcsx2/Input/SDLInputSource.cpp index be81f7cf42bd32..997f0c483ce310 100644 --- a/pcsx2/Input/SDLInputSource.cpp +++ b/pcsx2/Input/SDLInputSource.cpp @@ -128,7 +128,6 @@ static constexpr const char* s_sdl_default_led_colors[] = { static void SetControllerRGBLED(SDL_GameController* gc, u32 color) { SDL_GameControllerSetLED(gc, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); - SDL_GameControllerSetPlayerIndex(gc, -1); } static void SDLLogCallback(void* userdata, int category, SDL_LogPriority priority, const char* message) @@ -159,6 +158,7 @@ bool SDLInputSource::Initialize(SettingsInterface& si, std::unique_lock& settings_lock) { const bool old_controller_enhanced_mode = m_controller_enhanced_mode; + const bool old_controller_ps5_player_led = m_controller_ps5_player_led; const bool old_controller_raw_mode = m_controller_raw_mode; #ifdef __APPLE__ @@ -176,6 +176,7 @@ void SDLInputSource::UpdateSettings(SettingsInterface& si, std::unique_lock(i))); } si.SetBoolValue("InputSources", "SDLControllerEnhancedMode", false); + si.SetBoolValue("InputSources", "SDLPS5PlayerLED", false); si.SetBoolValue("Pad", "MultitapPort1", false); si.SetBoolValue("Pad", "MultitapPort2", false); si.SetFloatValue("Pad", "PointerXScale", 8.0f); @@ -329,6 +330,7 @@ void Pad::CopyConfiguration(SettingsInterface* dest_si, const SettingsInterface& InputManager::InputSourceToString(static_cast(i))); } dest_si->CopyBoolValue(src_si, "InputSources", "SDLControllerEnhancedMode"); + dest_si->CopyBoolValue(src_si, "InputSources", "SDLPS5PlayerLED"); } for (u32 port = 0; port < Pad::NUM_CONTROLLER_PORTS; port++)