fix SDL text events from generating a ~ key when opening the console

This commit is contained in:
Jeff Hutchinson 2016-12-10 20:56:07 -05:00
parent 630949514a
commit f6b8ef126d
3 changed files with 66 additions and 3 deletions

View file

@ -607,8 +607,10 @@ const UTF16 *PlatformWindowSDL::getCurtainWindowClassName()
void PlatformWindowSDL::setKeyboardTranslation(const bool enabled)
{
mEnableKeyboardTranslation = enabled;
if (mEnableKeyboardTranslation)
SDL_StartTextInput();
// Flag for update. Let SDL know what kind of input state we are changing to.
if (enabled)
mOwningManager->updateSDLTextInputState(PlatformWindowManagerSDL::KeyboardInputState::TEXT_INPUT);
else
SDL_StopTextInput();
mOwningManager->updateSDLTextInputState(PlatformWindowManagerSDL::KeyboardInputState::RAW_INPUT);
}