mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Added workaround for weird SDL behavior that causes SDL to report text
input as active when app starts until first actual text input
This commit is contained in:
@@ -21,6 +21,13 @@
|
||||
|
||||
#include <SDL_events.h>
|
||||
|
||||
InputSourceText::InputSourceText()
|
||||
{
|
||||
// For whatever reason, in SDL text input is considered to be active by default at least on desktop platforms
|
||||
// Apparently fixed in SDL3, but until then we need a workaround
|
||||
SDL_StopTextInput();
|
||||
}
|
||||
|
||||
void InputSourceText::handleEventTextInput(const SDL_TextInputEvent & text)
|
||||
{
|
||||
GH.events().dispatchTextInput(text.text);
|
||||
|
||||
Reference in New Issue
Block a user