diff --git a/source/glest_game/main/battle_end.cpp b/source/glest_game/main/battle_end.cpp index 3dafce0f5..4273642a7 100644 --- a/source/glest_game/main/battle_end.cpp +++ b/source/glest_game/main/battle_end.cpp @@ -435,9 +435,9 @@ void BattleEnd::render() { renderer.swapBuffers(); } -void BattleEnd::keyDown(char key){ +void BattleEnd::keyDown(SDL_KeyboardEvent key){ SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); - if(key == vkEscape || key == SDLK_ESCAPE) { + if(isKeyPressed(SDLK_ESCAPE,key) == true) { //program->setState(new MainMenu(program)); if(mainMessageBox.getEnabled()) { @@ -448,7 +448,7 @@ void BattleEnd::keyDown(char key){ showMessageBox(lang.get("ExitGame?"), "", true); } } - else if(key == vkReturn && mainMessageBox.getEnabled()) { + else if(isKeyPressed(SDLK_RETURN,key) && mainMessageBox.getEnabled()) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); program->setState(new MainMenu(program)); } diff --git a/source/glest_game/main/battle_end.h b/source/glest_game/main/battle_end.h index e2c4add6c..213f9afc7 100644 --- a/source/glest_game/main/battle_end.h +++ b/source/glest_game/main/battle_end.h @@ -45,7 +45,7 @@ public: virtual void update(); virtual void render(); - virtual void keyDown(char key); + virtual void keyDown(SDL_KeyboardEvent key); virtual void mouseDownLeft(int x, int y); virtual void mouseMove(int x, int y, const MouseState *ms); //virtual void tick(); diff --git a/source/glest_game/main/intro.cpp b/source/glest_game/main/intro.cpp index 050e7af91..52cc6452f 100644 --- a/source/glest_game/main/intro.cpp +++ b/source/glest_game/main/intro.cpp @@ -743,11 +743,11 @@ void Intro::render() { renderer.swapBuffers(); } -void Intro::keyDown(char key){ +void Intro::keyDown(SDL_KeyboardEvent key) { mouseUpLeft(0, 0); } -void Intro::mouseUpLeft(int x, int y){ +void Intro::mouseUpLeft(int x, int y) { SoundRenderer &soundRenderer= SoundRenderer::getInstance(); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); diff --git a/source/glest_game/main/intro.h b/source/glest_game/main/intro.h index af66fc4e8..3559743ea 100644 --- a/source/glest_game/main/intro.h +++ b/source/glest_game/main/intro.h @@ -119,7 +119,7 @@ public: virtual void update(); virtual void render(); - virtual void keyDown(char key); + virtual void keyDown(SDL_KeyboardEvent key); virtual void mouseUpLeft(int x, int y); void mouseMove(int x, int y, const MouseState *ms); };