From 67212a74919678217e29505bbf026eb6b87e9fb6 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Thu, 2 Jan 2003 20:39:29 +0000 Subject: [PATCH] Readded key repeat as the previous problem with it is now fixed git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@524 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/libs/input/sdl/input.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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