# HG changeset patch # User Sam Lantinga # Date 1150638867 0 # Node ID d36048e8e3023b713d32b24ac02e5172d081c4a1 # Parent 8d7fecceb9efeb4e3553a1489bae44379f84466f This trick only works for English diff -r 8d7fecceb9ef -r d36048e8e302 src/SDL_compat.c --- a/src/SDL_compat.c Sun Jun 18 13:47:19 2006 +0000 +++ b/src/SDL_compat.c Sun Jun 18 13:54:27 2006 +0000 @@ -208,12 +208,13 @@ { Uint32 unicode = 0; if (event->key.type == SDL_KEYDOWN && event->key.keysym.sym < 256) { - int shifted = !!(event->key.keysym.mod & KMOD_SHIFT); - int capslock = !!(event->key.keysym.mod & KMOD_CAPS); - if ((shifted ^ capslock) != 0) { - unicode = SDL_toupper(event->key.keysym.sym); - } else { - unicode = event->key.keysym.sym; + unicode = event->key.keysym.sym; + if(unicode >= 'a' && unicode <= 'z') { + int shifted = !!(event->key.keysym.mod & KMOD_SHIFT); + int capslock = !!(event->key.keysym.mod & KMOD_CAPS); + if ((shifted ^ capslock) != 0) { + unicode = SDL_toupper(unicode); + } } } if (unicode) {