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:
parent
047cc29787
commit
f51e1ee4ec
|
@ -77,16 +77,16 @@ KeyboardInputMap::KeyboardInputMap(){}
|
||||||
void KeyboardInputMap::AddMap(wxString keyStr, int key, int mod)
|
void KeyboardInputMap::AddMap(wxString keyStr, int key, int mod)
|
||||||
{
|
{
|
||||||
KeyboardInputMap* singleton = getInstance();
|
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)
|
bool KeyboardInputMap::GetMap(wxString keyStr, int &key, int &mod)
|
||||||
{
|
{
|
||||||
KeyboardInputMap* singleton = getInstance();
|
KeyboardInputMap* singleton = getInstance();
|
||||||
if (contains(singleton->keysMap, keyStr.wc_str())) {
|
if (contains(singleton->keysMap, keyStr.ToStdWstring())) {
|
||||||
key = singleton->keysMap.at(keyStr.wc_str()).key;
|
key = singleton->keysMap.at(keyStr.ToStdWstring()).key;
|
||||||
mod = singleton->keysMap.at(keyStr.wc_str()).mod;
|
mod = singleton->keysMap.at(keyStr.ToStdWstring()).mod;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue