Leave text input enabled unless text input shows some on-screen UI elements
authorSam Lantinga <slouken@libsdl.org>
Thu, 08 Nov 2012 11:18:21 -0800
changeset 6668 59c7c2db7638
parent 6667 243bfb5c31d6
child 6669 c08febc180b9
Leave text input enabled unless text input shows some on-screen UI elements
src/events/SDL_events.c
--- a/src/events/SDL_events.c	Thu Nov 08 11:15:02 2012 -0800
+++ b/src/events/SDL_events.c	Thu Nov 08 11:18:21 2012 -0800
@@ -125,10 +125,14 @@
 
     /* No filter to start with, process most event types */
     SDL_EventOK = NULL;
-    SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
-    SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
     SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
 
+    /* If text input shows UI onscreen we want to start with it disabled */
+    if (SDL_HasScreenKeyboardSupport()) {
+        SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
+        SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
+    }
+
     /* Create the lock and set ourselves active */
 #if !SDL_THREADS_DISABLED
     if (!SDL_EventQ.lock) {