diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 6f1ac66e2..cc1c94d10 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -883,13 +883,16 @@ void Gui::computeSelected(bool doubleClick){ bool controlDown= isKeyDown(vkControl); if(!shiftDown && !controlDown){ + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] about to call selection.clear()\n",__FILE__,__FUNCTION__,__LINE__); selection.clear(); } if(!controlDown){ + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] about to call selection.select(units)\n",__FILE__,__FUNCTION__,__LINE__); selection.select(units); } else{ + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] selection.unSelect(units)\n",__FILE__,__FUNCTION__,__LINE__); selection.unSelect(units); } } diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 9cc0da075..1175c3be3 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -794,8 +794,12 @@ bool isKeyDown(int virtualKey) { char key = static_cast (virtualKey); const Uint8* keystate = SDL_GetKeyState(0); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = %d\n",__FILE__,__FUNCTION__,__LINE__,key); + // kinda hack and wrong... if(key >= 0) { + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] keystate[key] = %d\n",__FILE__,__FUNCTION__,__LINE__,keystate[key]); + return keystate[key]; } switch(key) { @@ -827,6 +831,7 @@ bool isKeyDown(int virtualKey) { std::cerr << "isKeyDown called with unknown key.\n"; break; } + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] returning false\n",__FILE__,__FUNCTION__,__LINE__); return false; } diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index 787b3ed61..5fce7e51b 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -553,6 +553,15 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) { case SDLK_RSHIFT: return vkShift; } + if(keysym.mod & (KMOD_LALT | KMOD_RALT)) { + return vkAlt; + } + else if(keysym.mod & (KMOD_LCTRL | KMOD_RCTRL)) { + return vkControl; + } + else if(keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT)) { + return vkShift; + } } switch(keysym.sym) { case SDLK_PLUS: @@ -663,7 +672,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) { if(c == 0) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - if(skipSpecialKeys == false) { + if(skipSpecialKeys == true) { switch(keysym.sym) { case SDLK_LALT: case SDLK_RALT: @@ -675,6 +684,16 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) { case SDLK_RSHIFT: return vkShift; } + + if(keysym.mod & (KMOD_LALT | KMOD_RALT)) { + return vkAlt; + } + else if(keysym.mod & (KMOD_LCTRL | KMOD_RCTRL)) { + return vkControl; + } + else if(keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT)) { + return vkShift; + } } c = keysym.sym;