- don't close open messagebox on alt-enter

This commit is contained in:
Mark Vejvoda 2011-05-20 20:02:26 +00:00
parent af3c25850a
commit 737c577099
2 changed files with 15 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);