changeset 1687:d36048e8e302 SDL-1.3

This trick only works for English
author Sam Lantinga <slouken@libsdl.org>
date Sun, 18 Jun 2006 13:54:27 +0000
parents 8d7fecceb9ef
children c553a990dc32
files src/SDL_compat.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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) {