Added support for , and . as input keys.

This commit is contained in:
Pieter Hulshoff 2017-04-23 08:47:54 +02:00
parent 48a7e99784
commit 52b5a2fc46

View File

@ -121,8 +121,6 @@ bool UserInput::MapKey(std::string keyDescription, KeyCode_E key, bool required)
return false;
}
description = Utils::replace(description, ".", "");
std::istringstream ss(description);
std::string token;
@ -131,6 +129,8 @@ bool UserInput::MapKey(std::string keyDescription, KeyCode_E key, bool required)
while (std::getline(ss, token, ','))
{
token = Configuration::trimEnds(token);
if (token == "" && description != "") // Allow "," as input key
token = ",";
scanCode = SDL_GetScancodeFromName(token.c_str());
bool found = false;