diff --git a/src/InputManager.cpp b/src/InputManager.cpp index 142778445..462275397 100644 --- a/src/InputManager.cpp +++ b/src/InputManager.cpp @@ -252,7 +252,9 @@ bool InputManager::loadInputConfig(InputConfig* config) if(!root) return false; - pugi::xml_node configNode = root.find_child_by_attribute("inputConfig", "deviceGUID", getDeviceGUIDString(config->getDeviceId()).c_str()); + pugi::xml_node configNode = root.find_child_by_attribute("inputConfig", "deviceGUID", config->getDeviceGUIDString().c_str()); + if(!configNode) + configNode = root.find_child_by_attribute("inputConfig", "deviceName", config->getDeviceName().c_str()); if(!configNode) return false; @@ -304,6 +306,9 @@ void InputManager::writeDeviceConfig(InputConfig* config) pugi::xml_node oldEntry = root.find_child_by_attribute("inputConfig", "deviceGUID", config->getDeviceGUIDString().c_str()); if(oldEntry) root.remove_child(oldEntry); + oldEntry = root.find_child_by_attribute("inputConfig", "deviceName", config->getDeviceName().c_str()); + if(oldEntry) + root.remove_child(oldEntry); } } }