diff --git a/source/glest_game/main/program.cpp b/source/glest_game/main/program.cpp index f2c21c7c..e583dd1e 100644 --- a/source/glest_game/main/program.cpp +++ b/source/glest_game/main/program.cpp @@ -204,9 +204,13 @@ Program::~Program(){ void Program::keyDown(char key){ if(msgBox.getEnabled()) { + SDL_keysym keystate = Window::getKeystate(); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - if(key == vkEscape || key == SDLK_ESCAPE || key == vkReturn || key == SDLK_RETURN || key == SDLK_KP_ENTER) { + if(key == vkEscape || key == SDLK_ESCAPE || + ((key == vkReturn || key == SDLK_RETURN || key == SDLK_KP_ENTER) && !(keystate.mod & (KMOD_LALT | KMOD_RALT)))) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + + //printf("---> keystate [%d]\n",keystate); msgBox.setEnabled(false); } diff --git a/source/glest_game/menu/menu_state_root.cpp b/source/glest_game/menu/menu_state_root.cpp index cf691f81..9b3152a5 100644 --- a/source/glest_game/menu/menu_state_root.cpp +++ b/source/glest_game/menu/menu_state_root.cpp @@ -222,8 +222,16 @@ void MenuStateRoot::keyDown(char key) { showMessageBox(lang.get("ExitGame?"), "", true); } else if(mainMessageBox.getEnabled() == true && key == vkReturn) { - if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - program->exit(); + SDL_keysym keystate = Window::getKeystate(); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] keystate.mod [%d]\n",__FILE__,__FUNCTION__,__LINE__,keystate.mod); + + //printf("---> keystate.mod [%d]\n",keystate.mod); + if(keystate.mod & (KMOD_LALT | KMOD_RALT)) { + } + else { + //printf("EXITING ---> keystate.mod [%d]\n",keystate.mod); + program->exit(); + } } else if(key == configKeys.getCharKey("SaveGUILayout")) { bool saved = GraphicComponent::saveAllCustomProperties(containerName);