diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 2baf93fb4..b81d928a6 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ 0.2: +- Key repeat is now enabled when typing text, from slayne - Capital letter bug in new input code fixed, from slayne - Oscilloscope now reacts to music when speech is disabled (OpenAL) -Mika - Rewritten input code (better and adds joystick/pad support), from slayne diff --git a/sc2/src/sc2code/libs/input/sdl/input.c b/sc2/src/sc2code/libs/input/sdl/input.c index f206ec049..b5d607eec 100644 --- a/sc2/src/sc2code/libs/input/sdl/input.c +++ b/sc2/src/sc2code/libs/input/sdl/input.c @@ -49,7 +49,8 @@ TFB_InitInput (int driver, int flags) atexit (TFB_UninitInput); SDL_EnableUNICODE(1); - + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + if ((SDL_InitSubSystem(SDL_INIT_JOYSTICK)) == -1) { fprintf (stderr, "Couldn't initialize joystick subsystem: %s\n", SDL_GetError()); @@ -177,7 +178,13 @@ UninitInput (void) // Looks like it'll be empty void FlushInput (void) { + int i; kbdtail = kbdhead = 0; + for (i = 0; i < SDLK_LAST; ++i) + { + if (KeyboardDown[i] == 0x2) + KeyboardDown[i] &= ~0x2; + } } // Translates from SDLKeys to values defined in inplib.h