Skip to content

Commit

Permalink
InputCommon: fix 2nd+ controller not defaulting to the default device
Browse files Browse the repository at this point in the history
  • Loading branch information
Filoppi committed Jun 7, 2021
1 parent edc18e6 commit 702f86c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Source/Core/InputCommon/InputConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 702f86c

Please sign in to comment.