From 86f6c78fc48eb962581f105a7dd5237f922dc3ff Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Sun, 24 Dec 2017 12:24:41 +0300 Subject: [PATCH] #60 show soft keyboard when when screen touched or mode switched to console/code --- src/studio.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/studio.c b/src/studio.c index eb1ae10..4bc1946 100644 --- a/src/studio.c +++ b/src/studio.c @@ -978,6 +978,13 @@ void resumeRunMode() studio.mode = TIC_RUN_MODE; } +static void showSoftKeyboard() +{ + if(SDL_HasScreenKeyboardSupport()) + if(studio.mode == TIC_CONSOLE_MODE || studio.mode == TIC_CODE_MODE) + SDL_StartTextInput(); +} + void setStudioMode(EditorMode mode) { if(mode != studio.mode) @@ -1014,6 +1021,8 @@ void setStudioMode(EditorMode mode) } studio.mode = mode; + + showSoftKeyboard(); } } @@ -1978,9 +1987,7 @@ SDL_Event* pollEvent() } break; case SDL_FINGERUP: - if(SDL_HasScreenKeyboardSupport() && !SDL_IsTextInputActive()) - if(studio.mode == TIC_CONSOLE_MODE || studio.mode == TIC_CODE_MODE) - SDL_StartTextInput(); + showSoftKeyboard(); break; case SDL_QUIT: exitStudio();