From 57b887c8d8556565c0bae195fbe09428d0b4702c Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Sat, 26 Dec 2020 19:06:37 -0800 Subject: [PATCH] Put the Text Input code in the correct SDL version branch --- sc2/src/libs/input/sdl/input.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sc2/src/libs/input/sdl/input.c b/sc2/src/libs/input/sdl/input.c index 6a990ea79..1b333d2e6 100644 --- a/sc2/src/libs/input/sdl/input.c +++ b/sc2/src/libs/input/sdl/input.c @@ -375,20 +375,6 @@ ProcessInputEvent (const SDL_Event *Event) ProcessMouseEvent (Event); -#if SDL_MAJOR_VERSION > 1 - if (in_character_mode && !set_character_mode) - { - set_character_mode = TRUE; - SDL_StartTextInput (); - } - - if (!in_character_mode && set_character_mode) - { - set_character_mode = FALSE; - SDL_StopTextInput (); - } -#endif - // In character mode with NumLock on, numpad chars bypass VControl // so that menu arrow events are not produced if (!is_numpad_char_event (Event)) @@ -449,6 +435,18 @@ ProcessInputEvent (const SDL_Event *Event) ProcessMouseEvent (Event); + if (in_character_mode && !set_character_mode) + { + set_character_mode = TRUE; + SDL_StartTextInput (); + } + + if (!in_character_mode && set_character_mode) + { + set_character_mode = FALSE; + SDL_StopTextInput (); + } + /* TODO: Block numpad input when NUM_LOCK is on */ VControl_HandleEvent (Event);