#60 show soft keyboard when when screen touched or mode switched to console/code

This commit is contained in:
BADIM-PC\Vadim 2017-12-24 12:24:41 +03:00
parent abd3665c54
commit 86f6c78fc4
1 changed files with 10 additions and 3 deletions

View File

@ -978,6 +978,13 @@ void resumeRunMode()
studio.mode = TIC_RUN_MODE; 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) void setStudioMode(EditorMode mode)
{ {
if(mode != studio.mode) if(mode != studio.mode)
@ -1014,6 +1021,8 @@ void setStudioMode(EditorMode mode)
} }
studio.mode = mode; studio.mode = mode;
showSoftKeyboard();
} }
} }
@ -1978,9 +1987,7 @@ SDL_Event* pollEvent()
} }
break; break;
case SDL_FINGERUP: case SDL_FINGERUP:
if(SDL_HasScreenKeyboardSupport() && !SDL_IsTextInputActive()) showSoftKeyboard();
if(studio.mode == TIC_CONSOLE_MODE || studio.mode == TIC_CODE_MODE)
SDL_StartTextInput();
break; break;
case SDL_QUIT: case SDL_QUIT:
exitStudio(); exitStudio();