FifeGUI 0.3.0
A C++ GUI library designed for games.
textinputevent.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2026 Fifengine contributors
3
4// Corresponding header include
5#include "fifechan/events/textinputevent.hpp"
6
7// Standard library includes
8#include <string>
9#include <utility>
10
11namespace fcn
12{
14 Widget* source,
15 Widget* distributor,
16 bool isShiftPressed,
18 bool isAltPressed,
19 bool isMetaPressed,
20 std::string text,
21 Type type) :
23 mText(std::move(text)),
24 mType(type)
25 {
26 }
27
28 std::string const & TextInputEvent::getText() const
29 {
30 return mText;
31 }
32
37} // namespace fcn
InputEvent(Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed)
Constructor.
bool isAltPressed() const
Checks if alt is pressed.
bool isControlPressed() const
Checks if control is pressed.
bool isMetaPressed() const
Checks whether meta is pressed.
bool isShiftPressed() const
Checks if shift is pressed.
Type
Text event types.
std::string const & getText() const
Gets the text of the event.
Type mType
The type of text event.
std::string mText
The UTF-8 text.
TextInputEvent(Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed, std::string text, Type type=Type::Input)
Constructor.
Type getType() const
Gets the type of text event.
Abstract base class defining the common behavior, properties, and lifecycle of all GUI elements.
Definition widget.hpp:56
Used replacement tokens by configure_file():