diff --git a/source/glest_game/main/intro.cpp b/source/glest_game/main/intro.cpp index 14444eb4d..199030513 100644 --- a/source/glest_game/main/intro.cpp +++ b/source/glest_game/main/intro.cpp @@ -779,6 +779,20 @@ void Intro::render() { } void Intro::keyDown(SDL_KeyboardEvent key) { + SDL_keysym keystate = key.keysym; + //printf("keystate.mod = %d key = unicode[%d] regular[%d] lalt [%d] ralt [%d] alt [%d]\n",keystate.mod,key.keysym.unicode,key.keysym.sym,(keystate.mod & KMOD_LALT),(keystate.mod & KMOD_RALT),(keystate.mod & KMOD_ALT)); + + if(keystate.mod & (KMOD_LALT | KMOD_RALT)) { + //printf("ALT KEY #1\n"); + + if(isKeyPressed(SDLK_RETURN,key) == true || + isKeyPressed(SDLK_RALT,key) == true || + isKeyPressed(SDLK_LALT,key) == true) { + return; + } + } + + //printf("Exiting intro\n"); mouseUpLeft(0, 0); } diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index d2534e56e..bfaf223a2 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -960,6 +960,7 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) { //SDL_keysym keystate = Window::getKeystate(); SDL_keysym keystate = key.keysym; + //printf("keystate.mod = %d key = %d lalt [%d] ralt [%d] alt [%d]\n",keystate.mod,key.keysym.unicode,(keystate.mod & KMOD_LALT),(keystate.mod & KMOD_RALT),(keystate.mod & KMOD_ALT)); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c][%d]\n",__FILE__,__FUNCTION__,__LINE__,key,key); diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index 8273ca151..fd76694dc 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -185,9 +185,10 @@ bool Window::handleEvent() { codeLocation = "i"; Window::isKeyPressedDown = true; -#ifdef WIN32 +//#ifdef WIN32 + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("KD mod = %d : %d\n",event.key.keysym.mod,SDL_GetModState()); event.key.keysym.mod = SDL_GetModState(); -#endif +//#endif keystate = event.key.keysym; string keyName = SDL_GetKeyName(event.key.keysym.sym); @@ -213,6 +214,7 @@ bool Window::handleEvent() { //key = tolower(key); //if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("******************* key [%d]\n",key); + //event.key.keysym.mod = SDL_GetModState(); global_window->eventKeyDown(event.key); global_window->eventKeyPress(event.key); @@ -231,9 +233,10 @@ bool Window::handleEvent() { codeLocation = "j"; Window::isKeyPressedDown = false; -#ifdef WIN32 +//#ifdef WIN32 + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("KU mod = %d : %d\n",event.key.keysym.mod,SDL_GetModState()); event.key.keysym.mod = SDL_GetModState(); -#endif +//#endif keystate = event.key.keysym; @@ -804,6 +807,8 @@ bool isKeyPressed(SDLKey compareKey, SDL_KeyboardEvent input,bool modifiersAllow string compareKeyName = SDL_GetKeyName(compareKey); string pressKeyName = SDL_GetKeyName((SDLKey)c); + //printf ("In [%s::%s Line: %d] compareKey [%d - %s] pressed key [%d - %s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,compareKey,compareKeyName.c_str(),c,pressKeyName.c_str(),result); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] compareKey [%d - %s] pressed key [%d - %s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,compareKey,compareKeyName.c_str(),c,pressKeyName.c_str(),result); //printf ("ISPRESS compareKey [%d - %s] pressed key [%d - %s] input.keysym.sym [%d] input.keysym.unicode [%d] mod = %d result = %d\n", // compareKey,compareKeyName.c_str(),c,pressKeyName.c_str(),input.keysym.sym,input.keysym.unicode,input.keysym.mod,result);