|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <textinputevent.hpp>
Public Types | |
| enum class | Type : std::uint8_t { Input = 0 , Editing } |
Public Member Functions | |
| std::string const & | getText () const |
| Type | getType () const |
| TextInputEvent (Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed, std::string text, Type type=Type::Input) | |
| Public Member Functions inherited from fcn::InputEvent | |
| void | consume () |
| Widget * | getDistributor () const |
| uint16_t | getModMask () const |
| InputEvent (Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed) | |
| bool | isAltPressed () const |
| bool | isConsumed () const |
| bool | isControlPressed () const |
| bool | isMetaPressed () const |
| bool | isShiftPressed () const |
| Public Member Functions inherited from fcn::Event | |
| Event (Widget *source) | |
| Widget * | getSource () const |
Protected Attributes | |
| std::string | mText |
| Type | mType {Type::Input} |
| Protected Attributes inherited from fcn::InputEvent | |
| Widget * | mDistributor |
| bool | mIsConsumed |
| uint16_t | mModMask {0} |
| Protected Attributes inherited from fcn::Event | |
| Widget * | mSource {nullptr} |
Additional Inherited Members | |
| Static Public Attributes inherited from fcn::InputEvent | |
| static constexpr uint16_t | ModAlt = 1 << 2 |
| static constexpr uint16_t | ModControl = 1 << 1 |
| static constexpr uint16_t | ModMeta = 1 << 3 |
| static constexpr uint16_t | ModShift = 1 << 0 |
Text input event for IME (input method editor) composition, dead keys, and pasted text.
Fired on SDL_EVENT_TEXT_INPUT. Carries UTF-8 text and remains separate from KeyEvent so composed input is not collapsed into a single keycode.
Inherits InputEvent, including modifier-state queries (isShiftPressed(), etc.) and the consume() mechanism. This allows IME-aware widgets such as TextField to consume text input before the originating keystrokes are processed as hotkeys.
Definition at line 35 of file textinputevent.hpp.
|
strong |
Text event types.
| Enumerator | |
|---|---|
| Input | Text was input (SDL_EVENT_TEXT_INPUT). |
| Editing | IME composition in progress (SDL_EVENT_TEXT_EDITING). |
Definition at line 41 of file textinputevent.hpp.
| fcn::TextInputEvent::TextInputEvent | ( | Widget * | source, |
| Widget * | distributor, | ||
| bool | isShiftPressed, | ||
| bool | isControlPressed, | ||
| bool | isAltPressed, | ||
| bool | isMetaPressed, | ||
| std::string | text, | ||
| Type | type = Type::Input ) |
Constructor.
| source | The source widget. |
| distributor | The distributor of the event. |
| isShiftPressed | True if shift is pressed. |
| isControlPressed | True if control is pressed. |
| isAltPressed | True if alt is pressed. |
| isMetaPressed | True if meta is pressed. |
| text | The UTF-8 text that was input. |
| type | The type of text event. |
Definition at line 13 of file textinputevent.cpp.
References fcn::InputEvent::InputEvent(), fcn::InputEvent::isAltPressed(), fcn::InputEvent::isControlPressed(), fcn::InputEvent::isMetaPressed(), fcn::InputEvent::isShiftPressed(), mText, and mType.
| std::string const & fcn::TextInputEvent::getText | ( | ) | const |
Gets the text of the event.
Definition at line 28 of file textinputevent.cpp.
References mText.
| TextInputEvent::Type fcn::TextInputEvent::getType | ( | ) | const |
Gets the type of text event.
Definition at line 33 of file textinputevent.cpp.
References mType.
|
protected |
The UTF-8 text.
Definition at line 85 of file textinputevent.hpp.
Referenced by getText(), and TextInputEvent().
|
protected |
The type of text event.
Definition at line 88 of file textinputevent.hpp.
Referenced by getType(), and TextInputEvent().