Put the Text Input code in the correct SDL version branch

This commit is contained in:
Michael Martin
2020-12-26 19:06:37 -08:00
parent 8d3698f4b7
commit 57b887c8d8
+12 -14
View File
@@ -375,20 +375,6 @@ ProcessInputEvent (const SDL_Event *Event)
ProcessMouseEvent (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 // In character mode with NumLock on, numpad chars bypass VControl
// so that menu arrow events are not produced // so that menu arrow events are not produced
if (!is_numpad_char_event (Event)) if (!is_numpad_char_event (Event))
@@ -449,6 +435,18 @@ ProcessInputEvent (const SDL_Event *Event)
ProcessMouseEvent (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 */ /* TODO: Block numpad input when NUM_LOCK is on */
VControl_HandleEvent (Event); VControl_HandleEvent (Event);