diff src/SDL_compat.c @ 3280:00cace2d9080

Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
author Sam Lantinga <slouken@libsdl.org>
date Sat, 19 Sep 2009 13:29:40 +0000
parents 7f684f249ec9
children 4b594623401b
line wrap: on
line diff
--- a/src/SDL_compat.c	Sat Sep 19 12:48:52 2009 +0000
+++ b/src/SDL_compat.c	Sat Sep 19 13:29:40 2009 +0000
@@ -40,6 +40,7 @@
 static Uint32 SDL_VideoFlags = 0;
 static char *wm_title = NULL;
 static SDL_Surface *SDL_VideoIcon;
+static int SDL_enabled_UNICODE = 0;
 
 char *
 SDL_AudioDriverName(char *namebuf, int maxlen)
@@ -1720,7 +1721,19 @@
 int
 SDL_EnableUNICODE(int enable)
 {
-    return SDL_EventState(SDL_TEXTINPUT, enable);
+    int previous = SDL_enabled_UNICODE;
+
+    switch (enable) {
+    case 1:
+        SDL_enabled_UNICODE = 1;
+        SDL_StartTextInput();
+        break;
+    case 0:
+        SDL_enabled_UNICODE = 0;
+        SDL_StopTextInput();
+        break;
+    }
+    return previous;
 }
 
 /* vi: set ts=4 sw=4 expandtab: */