- 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 result;
|
||||
SDLKey result = SDLK_UNKNOWN;
|
||||
if(c < 0) {
|
||||
switch(c) {
|
||||
case vkAdd:
|
||||
|
|
|
@ -363,9 +363,14 @@ void MenuStateKeysetup::keyUp(char key) {
|
|||
for(int i = 0; i < userProperties.size(); ++i) {
|
||||
string hotKeyName = userProperties[i].first;
|
||||
if(nameValuePair.first == hotKeyName) {
|
||||
if(keysym > 255) {
|
||||
if(keysym <= SDLK_ESCAPE || keysym > 255) {
|
||||
if(keysym <= SDLK_ESCAPE) {
|
||||
userProperties[i].second = intToStr(key);
|
||||
}
|
||||
else {
|
||||
userProperties[i].second = keyName;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userProperties[i].second = "";
|
||||
userProperties[i].second.push_back(key);
|
||||
|
@ -376,9 +381,14 @@ void MenuStateKeysetup::keyUp(char key) {
|
|||
}
|
||||
if(isNewUserKeyEntry == true) {
|
||||
pair<string,string> newNameValuePair = nameValuePair;
|
||||
if(keysym > 255) {
|
||||
if(keysym <= SDLK_ESCAPE || keysym > 255) {
|
||||
if(keysym <= SDLK_ESCAPE) {
|
||||
newNameValuePair.second = intToStr(key);
|
||||
}
|
||||
else {
|
||||
newNameValuePair.second = keyName;
|
||||
}
|
||||
}
|
||||
else {
|
||||
newNameValuePair.second = key;
|
||||
}
|
||||
|
|
|
@ -201,6 +201,7 @@ void MenuStateRoot::update(){
|
|||
void MenuStateRoot::keyDown(char 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));
|
||||
//exit
|
||||
|
|
|
@ -689,8 +689,11 @@ char Window::getNormalKey(SDL_keysym keysym,bool skipSpecialKeys) {
|
|||
if(keyName == "minus sign" || keyName == "minus") {
|
||||
return vkSubtract;
|
||||
}
|
||||
//if(keyName == "escape") {
|
||||
// return vkEscape;
|
||||
//}
|
||||
if(keyName == "escape") {
|
||||
return vkEscape;
|
||||
return unicodeKey;
|
||||
}
|
||||
if(keyName == "tab") {
|
||||
return vkTab;
|
||||
|
|
Loading…
Reference in New Issue
Block a user