- does this finally fix stupid keyboard mapping issues on different locales?

This commit is contained in:
Mark Vejvoda 2011-03-01 23:33:59 +00:00
parent 3f32cddbf5
commit 18c863364f

View File

@ -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()); 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 */ /* 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))) { && (event.key.keysym.mod & (KMOD_LALT | KMOD_RALT))) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] SDLK_RETURN pressed.\n",__FILE__,__FUNCTION__,__LINE__); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] SDLK_RETURN pressed.\n",__FILE__,__FUNCTION__,__LINE__);
toggleFullscreen(); 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); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] keysym.sym [%d] skipSpecialKeys = %d.\n",__FILE__,__FUNCTION__,__LINE__,keysym.sym,skipSpecialKeys);
if(skipSpecialKeys == false) { if(skipSpecialKeys == false) {
switch(keysym.sym) { switch(keysym.unicode) {
case SDLK_LALT: case SDLK_LALT:
case SDLK_RALT: case SDLK_RALT:
return vkAlt; return vkAlt;
@ -612,7 +612,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) {
return vkShift; return vkShift;
} }
} }
switch(keysym.sym) { switch(keysym.unicode) {
case SDLK_PLUS: case SDLK_PLUS:
case SDLK_KP_PLUS: case SDLK_KP_PLUS:
return vkAdd; 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__); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(skipSpecialKeys == true) { if(skipSpecialKeys == true) {
switch(keysym.sym) { switch(keysym.unicode) {
case SDLK_LALT: case SDLK_LALT:
case SDLK_RALT: case SDLK_RALT:
return vkAlt; 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); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %u] c = [%d]\n",__FILE__,__FUNCTION__,__LINE__,c);