Fix for non-stl wx builds.

Followup on baa0341b.

Use ToStdWstring() instead of wc_str() to look up strings in the map,
the key for the map is std::wstring.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2020-06-23 02:02:16 +00:00
parent 047cc29787
commit f51e1ee4ec
1 changed files with 4 additions and 4 deletions

View File

@ -77,16 +77,16 @@ KeyboardInputMap::KeyboardInputMap(){}
void KeyboardInputMap::AddMap(wxString keyStr, int key, int mod)
{
KeyboardInputMap* singleton = getInstance();
singleton->keysMap[keyStr.wc_str()] = singleton->newPair(key, mod);
singleton->keysMap[keyStr.ToStdWstring()] = singleton->newPair(key, mod);
}
bool KeyboardInputMap::GetMap(wxString keyStr, int &key, int &mod)
{
KeyboardInputMap* singleton = getInstance();
if (contains(singleton->keysMap, keyStr.wc_str())) {
key = singleton->keysMap.at(keyStr.wc_str()).key;
mod = singleton->keysMap.at(keyStr.wc_str()).mod;
if (contains(singleton->keysMap, keyStr.ToStdWstring())) {
key = singleton->keysMap.at(keyStr.ToStdWstring()).key;
mod = singleton->keysMap.at(keyStr.ToStdWstring()).mod;
return true;
}
return false;