diff options
| author | JMC47 <JMC4789@gmail.com> | 2021-06-09 16:09:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-09 16:09:09 -0400 |
| commit | 0aa9e8dc9a47cc50baf4e785da1b2ce5f2246b17 (patch) | |
| tree | 1395dca24977cdc4f2ca3849ae0b05093462f515 /Source/Core/InputCommon/InputConfig.cpp | |
| parent | c729852d72f7dcd9877fd4b4a002a0f0d91dcd66 (diff) | |
| parent | 702f86ccc01fb1b9055e1acb77541f432a5cac57 (diff) | |
Merge pull request #9795 from Filoppi/fix_controller2_default_device
Fix controllers after the first one not defaulting to the default device
Diffstat (limited to 'Source/Core/InputCommon/InputConfig.cpp')
| -rw-r--r-- | Source/Core/InputCommon/InputConfig.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/InputConfig.cpp b/Source/Core/InputCommon/InputConfig.cpp index 3b9fb7f809..7d7880da49 100644 --- a/Source/Core/InputCommon/InputConfig.cpp +++ b/Source/Core/InputCommon/InputConfig.cpp @@ -145,8 +145,23 @@ bool InputConfig::LoadConfig(bool isGC) } else { - m_controllers[0]->LoadDefaults(g_controller_interface); - m_controllers[0]->UpdateReferences(g_controller_interface); + // Only load the default profile for the first controller, + // otherwise they would all share the same mappings and default device + if (m_controllers.size() > 0) + { + m_controllers[0]->LoadDefaults(g_controller_interface); + m_controllers[0]->UpdateReferences(g_controller_interface); + } + // Set the "default" default device for all other controllers, or they would end up + // having no default device (which is fine, but might be confusing for some users) + const std::string& default_device_string = g_controller_interface.GetDefaultDeviceString(); + if (!default_device_string.empty()) + { + for (size_t i = 1; i < m_controllers.size(); ++i) + { + m_controllers[i]->SetDefaultDevice(default_device_string); + } + } return false; } } |
