- bugfix for esc key
This commit is contained in:
parent
76919f81b6
commit
5b2a6bb45f
|
@ -265,7 +265,7 @@ const string Config::getString(const string &key,const char *defaultValueIfNotFo
|
||||||
}
|
}
|
||||||
|
|
||||||
SDLKey Config::translateSpecialStringToSDLKey(char c) const {
|
SDLKey Config::translateSpecialStringToSDLKey(char c) const {
|
||||||
SDLKey result;
|
SDLKey result = SDLK_UNKNOWN;
|
||||||
if(c < 0) {
|
if(c < 0) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case vkAdd:
|
case vkAdd:
|
||||||
|
|
|
@ -363,8 +363,13 @@ void MenuStateKeysetup::keyUp(char key) {
|
||||||
for(int i = 0; i < userProperties.size(); ++i) {
|
for(int i = 0; i < userProperties.size(); ++i) {
|
||||||
string hotKeyName = userProperties[i].first;
|
string hotKeyName = userProperties[i].first;
|
||||||
if(nameValuePair.first == hotKeyName) {
|
if(nameValuePair.first == hotKeyName) {
|
||||||
if(keysym > 255) {
|
if(keysym <= SDLK_ESCAPE || keysym > 255) {
|
||||||
userProperties[i].second = keyName;
|
if(keysym <= SDLK_ESCAPE) {
|
||||||
|
userProperties[i].second = intToStr(key);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
userProperties[i].second = keyName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
userProperties[i].second = "";
|
userProperties[i].second = "";
|
||||||
|
@ -376,8 +381,13 @@ void MenuStateKeysetup::keyUp(char key) {
|
||||||
}
|
}
|
||||||
if(isNewUserKeyEntry == true) {
|
if(isNewUserKeyEntry == true) {
|
||||||
pair<string,string> newNameValuePair = nameValuePair;
|
pair<string,string> newNameValuePair = nameValuePair;
|
||||||
if(keysym > 255) {
|
if(keysym <= SDLK_ESCAPE || keysym > 255) {
|
||||||
newNameValuePair.second = keyName;
|
if(keysym <= SDLK_ESCAPE) {
|
||||||
|
newNameValuePair.second = intToStr(key);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
newNameValuePair.second = keyName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
newNameValuePair.second = key;
|
newNameValuePair.second = key;
|
||||||
|
|
|
@ -201,6 +201,7 @@ void MenuStateRoot::update(){
|
||||||
void MenuStateRoot::keyDown(char key) {
|
void MenuStateRoot::keyDown(char key) {
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key,key);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key,key);
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] key = [%d - %c]\n",__FILE__,__FUNCTION__,__LINE__,key,key);
|
||||||
|
|
||||||
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
||||||
//exit
|
//exit
|
||||||
|
|
|
@ -689,8 +689,11 @@ char Window::getNormalKey(SDL_keysym keysym,bool skipSpecialKeys) {
|
||||||
if(keyName == "minus sign" || keyName == "minus") {
|
if(keyName == "minus sign" || keyName == "minus") {
|
||||||
return vkSubtract;
|
return vkSubtract;
|
||||||
}
|
}
|
||||||
|
//if(keyName == "escape") {
|
||||||
|
// return vkEscape;
|
||||||
|
//}
|
||||||
if(keyName == "escape") {
|
if(keyName == "escape") {
|
||||||
return vkEscape;
|
return unicodeKey;
|
||||||
}
|
}
|
||||||
if(keyName == "tab") {
|
if(keyName == "tab") {
|
||||||
return vkTab;
|
return vkTab;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user