Leave text input enabled unless text input shows some on-screen UI elements
authorSam Lantinga
Thu, 08 Nov 2012 11:18:21 -0800
changeset 666859c7c2db7638
parent 6667 243bfb5c31d6
child 6669 c08febc180b9
Leave text input enabled unless text input shows some on-screen UI elements
src/events/SDL_events.c
     1.1 --- a/src/events/SDL_events.c	Thu Nov 08 11:15:02 2012 -0800
     1.2 +++ b/src/events/SDL_events.c	Thu Nov 08 11:18:21 2012 -0800
     1.3 @@ -125,10 +125,14 @@
     1.4  
     1.5      /* No filter to start with, process most event types */
     1.6      SDL_EventOK = NULL;
     1.7 -    SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
     1.8 -    SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
     1.9      SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
    1.10  
    1.11 +    /* If text input shows UI onscreen we want to start with it disabled */
    1.12 +    if (SDL_HasScreenKeyboardSupport()) {
    1.13 +        SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
    1.14 +        SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
    1.15 +    }
    1.16 +
    1.17      /* Create the lock and set ourselves active */
    1.18  #if !SDL_THREADS_DISABLED
    1.19      if (!SDL_EventQ.lock) {