Call SDL_StopTextInput() during init.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 10 Mar 2019 00:18:10 -0500
changeset 113ed19faa58a82
parent 112 be327fd46284
child 114 f4f3bf9e36e1
Call SDL_StopTextInput() during init.

Otherwise, macOS might pop up a choose-an-accented-letter window if you hold
down a key, which looks really weird in an FPS.

I had never seen this happen before, so it's not clear why this has to be
done here or if it was a fluke or something. But for now it works, and it's
not like SDL 1.2 has proper text input anyhow.
src/SDL12_compat.c
src/SDL20_syms.h
     1.1 --- a/src/SDL12_compat.c	Sun Mar 10 00:16:12 2019 -0500
     1.2 +++ b/src/SDL12_compat.c	Sun Mar 10 00:18:10 2019 -0500
     1.3 @@ -1112,6 +1112,8 @@
     1.4          return -1;
     1.5      }
     1.6  
     1.7 +    SDL20_StopTextInput();
     1.8 +
     1.9      return 0;
    1.10  }
    1.11  
     2.1 --- a/src/SDL20_syms.h	Sun Mar 10 00:16:12 2019 -0500
     2.2 +++ b/src/SDL20_syms.h	Sun Mar 10 00:18:10 2019 -0500
     2.3 @@ -128,6 +128,7 @@
     2.4  
     2.5  SDL20_SYM_PASSTHROUGH(void,SetModState,(SDL_Keymod a),(a),)
     2.6  SDL20_SYM_PASSTHROUGH(SDL_Keymod,GetModState,(void),(),return)
     2.7 +SDL20_SYM(void,StopTextInput,(void),(),)
     2.8  
     2.9  SDL20_SYM(Uint32,GetMouseState,(int *a, int *b),(a,b),return)
    2.10  SDL20_SYM(Uint32,GetRelativeMouseState,(int *a, int *b),(a,b),return)