1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/client/eventsSDL/InputSourceText.h
Ivan Savenko 611249d11d Added workaround for weird SDL behavior that causes SDL to report text
input as active when app starts until first actual text input
2024-04-11 22:00:20 +03:00

32 lines
710 B
C++

/*
* InputSourceText.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class Rect;
VCMI_LIB_NAMESPACE_END
struct SDL_TextEditingEvent;
struct SDL_TextInputEvent;
/// Class that handles text input (e.g. IME or direct input from physical keyboard) from SDL events
class InputSourceText
{
public:
InputSourceText();
void handleEventTextInput(const SDL_TextInputEvent & current);
void handleEventTextEditing(const SDL_TextEditingEvent & current);
void startTextInput(const Rect & where);
void stopTextInput();
};