From 18c863364fc1c0db3a299e48b995abdd5fd04cd6 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 1 Mar 2011 23:33:59 +0000 Subject: [PATCH] - does this finally fix stupid keyboard mapping issues on different locales? --- source/shared_lib/sources/platform/sdl/window.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index 23473c45..d8a144e3 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -176,7 +176,7 @@ bool Window::handleEvent() { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Raw SDL key [%d] mod [%d] unicode [%d] scancode [%d] keyName [%s]\n",__FILE__,__FUNCTION__,__LINE__,event.key.keysym.sym,event.key.keysym.mod,event.key.keysym.unicode,event.key.keysym.scancode,keyName.c_str()); /* handle ALT+Return */ - if(event.key.keysym.sym == SDLK_RETURN + if(event.key.keysym.unicode == SDLK_RETURN && (event.key.keysym.mod & (KMOD_LALT | KMOD_RALT))) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] SDLK_RETURN pressed.\n",__FILE__,__FUNCTION__,__LINE__); toggleFullscreen(); @@ -591,7 +591,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] keysym.sym [%d] skipSpecialKeys = %d.\n",__FILE__,__FUNCTION__,__LINE__,keysym.sym,skipSpecialKeys); if(skipSpecialKeys == false) { - switch(keysym.sym) { + switch(keysym.unicode) { case SDLK_LALT: case SDLK_RALT: return vkAlt; @@ -612,7 +612,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) { return vkShift; } } - switch(keysym.sym) { + switch(keysym.unicode) { case SDLK_PLUS: case SDLK_KP_PLUS: return vkAdd; @@ -764,7 +764,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(skipSpecialKeys == true) { - switch(keysym.sym) { + switch(keysym.unicode) { case SDLK_LALT: case SDLK_RALT: return vkAlt; @@ -787,7 +787,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) { } } - c = keysym.sym; + c = keysym.unicode; } SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %u] c = [%d]\n",__FILE__,__FUNCTION__,__LINE__,c);