diff --git a/RetroFE/Source/Control/UserInput.cpp b/RetroFE/Source/Control/UserInput.cpp index 8f803e8..6d409af 100644 --- a/RetroFE/Source/Control/UserInput.cpp +++ b/RetroFE/Source/Control/UserInput.cpp @@ -130,6 +130,7 @@ bool UserInput::MapKey(std::string keyDescription, KeyCode_E key, bool required) while (std::getline(ss, token, ',')) { + token = Configuration::trimEnds(token); scanCode = SDL_GetScancodeFromName(token.c_str()); bool found = false; diff --git a/RetroFE/Source/Database/Configuration.h b/RetroFE/Source/Database/Configuration.h index da17d2b..1ab8c63 100644 --- a/RetroFE/Source/Database/Configuration.h +++ b/RetroFE/Source/Database/Configuration.h @@ -26,6 +26,7 @@ public: virtual ~Configuration(); static void initialize(); static std::string convertToAbsolutePath(std::string prefix, std::string path); + static std::string trimEnds(std::string str); // gets the global configuration bool import(std::string keyPrefix, std::string file); bool import(std::string collection, std::string keyPrefix, std::string file, bool mustExist = true); @@ -45,7 +46,6 @@ public: private: bool getRawProperty(std::string key, std::string &value); bool parseLine(std::string collection, std::string keyPrefix, std::string line, int lineCount); - std::string trimEnds(std::string str); typedef std::map PropertiesType; typedef std::pair PropertiesPair;