mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-28 00:29:34 +00:00
Corrects input issues when typing into text fields and it bleeding through to player inputs.
This commit is contained in:
parent
e8d1238794
commit
4c13906865
3 changed files with 17 additions and 6 deletions
|
|
@ -484,12 +484,6 @@ void PlatformWindowSDL::_triggerKeyNotify(const SDL_Event& evt)
|
|||
keyEvent.trigger(getWindowId(), torqueModifiers, inputAction, torqueKey);
|
||||
//Con::printf("Key %d : %d", tKey.sym, inputAction);
|
||||
}
|
||||
|
||||
// stop SDL_TEXTINPUT event when unwanted
|
||||
if( inputAction == IA_MAKE && getKeyboardTranslation() && shouldNotTranslate( torqueModifiers, torqueKey ) )
|
||||
SDL_StopTextInput();
|
||||
else
|
||||
SDL_StartTextInput();
|
||||
}
|
||||
|
||||
void PlatformWindowSDL::_triggerTextNotify(const SDL_Event& evt)
|
||||
|
|
@ -606,3 +600,12 @@ const UTF16 *PlatformWindowSDL::getCurtainWindowClassName()
|
|||
static String str("CurtainWindowClassName");
|
||||
return str.utf16();
|
||||
}
|
||||
|
||||
void PlatformWindowSDL::setKeyboardTranslation(const bool enabled)
|
||||
{
|
||||
mEnableKeyboardTranslation = enabled;
|
||||
if (mEnableKeyboardTranslation)
|
||||
SDL_StartTextInput();
|
||||
else
|
||||
SDL_StopTextInput();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue