This trick only works for English SDL-1.3
authorSam Lantinga <slouken@libsdl.org>
Sun, 18 Jun 2006 13:54:27 +0000
branchSDL-1.3
changeset 1687 d36048e8e302
parent 1686 8d7fecceb9ef
child 1688 c553a990dc32
This trick only works for English
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) {