From f88836203ae07b37d94d7a9813f0777891fa5ba6 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 12 Mar 2011 03:10:07 +0000 Subject: [PATCH] - another keyboard bugfix (pressing esc properly cancels chat mode), Thanks ultifd --- source/glest_game/game/chat_manager.cpp | 3 +-- source/glest_game/main/battle_end.cpp | 2 +- source/glest_game/main/program.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/glest_game/game/chat_manager.cpp b/source/glest_game/game/chat_manager.cpp index c735ebcc..cb5918a4 100644 --- a/source/glest_game/game/chat_manager.cpp +++ b/source/glest_game/game/chat_manager.cpp @@ -58,8 +58,7 @@ void ChatManager::keyUp(char key) { if(editEnabled) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key,key); - if(key == vkEscape) - { + if(key == vkEscape || key == SDLK_ESCAPE) { text.clear(); editEnabled= false; } diff --git a/source/glest_game/main/battle_end.cpp b/source/glest_game/main/battle_end.cpp index 468c2e39..7a816d60 100644 --- a/source/glest_game/main/battle_end.cpp +++ b/source/glest_game/main/battle_end.cpp @@ -208,7 +208,7 @@ void BattleEnd::render(){ void BattleEnd::keyDown(char key){ SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); - if(key == vkEscape) { + if(key == vkEscape || key == SDLK_ESCAPE) { //program->setState(new MainMenu(program)); if(mainMessageBox.getEnabled()) { diff --git a/source/glest_game/main/program.cpp b/source/glest_game/main/program.cpp index deacbeff..32977ac4 100644 --- a/source/glest_game/main/program.cpp +++ b/source/glest_game/main/program.cpp @@ -187,7 +187,7 @@ void Program::keyDown(char key){ if(msgBox.getEnabled()) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - if(key == vkEscape || key == vkReturn) { + if(key == vkEscape || key == SDLK_ESCAPE || key == vkReturn || key == SDLK_RETURN || key == SDLK_KP_ENTER) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); msgBox.setEnabled(false);