From ea8ce1d5c7376901b71a566d9e4bedfea3f322d5 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 4 Mar 2011 01:32:10 +0000 Subject: [PATCH] - fixed bug with unicode keypresses while pressing control --- .../sources/platform/sdl/window.cpp | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index 0e4b7272..06afd240 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -599,17 +599,20 @@ MouseButton Window::getMouseButton(int sdlButton) { char Window::getRawKey(SDL_keysym keysym) { char result = 0; - Uint16 c = keysym.unicode; - if(c != 0 && (c & 0xFF80) == 0) { - SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - c = keysym.unicode & 0x7F; - //c = toupper(c); - result = (c & 0xFF); + if(keysym.mod & (KMOD_LCTRL | KMOD_RCTRL) == 0) { + Uint16 c = keysym.unicode; + if(c != 0 && (c & 0xFF80) == 0) { + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + //c = keysym.unicode & 0x7F; + //c = toupper(c); + result = (c & 0xFF); + //result = c; - //if(c != 0) { - if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] returning key [%d]\n",__FILE__,__FUNCTION__,__LINE__,result); - return result; - //} + //if(c != 0) { + if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] returning key [%d]\n",__FILE__,__FUNCTION__,__LINE__,result); + return result; + //} + } } if(keysym.sym <= 255) { result = keysym.sym;