- more debugging for keyboard issues

This commit is contained in:
Mark Vejvoda 2011-03-09 05:46:28 +00:00
parent 323f72ea6e
commit 2c0353972f

View File

@ -608,7 +608,7 @@ char Window::getRawKey(SDL_keysym keysym) {
//if(c != 0 && (c & 0xFF80) == 0) {
if(keysym.unicode > 0 && keysym.unicode < 0x80) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
result = keysym.unicode;
result = static_cast<char>(keysym.unicode);
//c = toupper(c);
//result = (c & 0xFF);
//result = c;
@ -646,9 +646,12 @@ char Window::getNormalKey(SDL_keysym keysym,bool skipSpecialKeys) {
unicodeKey = keysym.sym;
}
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unicodeKey [%d]\n",__FILE__,__FUNCTION__,__LINE__,unicodeKey);
//string keyName = SDL_GetKeyName(keysym.sym);
string keyName = SDL_GetKeyName(unicodeKey);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] Raw SDL key [%d] mod [%d] unicode [%d] scancode [%d] keyName [%s]\n",__FILE__,__FUNCTION__,__LINE__,keysym.sym,keysym.mod,keysym.unicode,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__,keysym.sym,keysym.mod,keysym.unicode,keysym.scancode,keyName.c_str());
if(skipSpecialKeys == false) {
if(keyName == "left alt" || keyName == "right alt") {
@ -880,6 +883,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) {
char result = getNormalKey(keysym,skipSpecialKeys);
if(result != 0) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] returning key [%d]\n",__FILE__,__FUNCTION__,__LINE__,result);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] returning key [%d]\n",__FILE__,__FUNCTION__,__LINE__,result);
return result;
}