FifeGUI 0.2.0
A C++ GUI library designed for games.
inputevent.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_INPUTEVENT_HPP_
6#define INCLUDE_FIFECHAN_INPUTEVENT_HPP_
7
8#include "fifechan/event.hpp"
9#include "fifechan/platform.hpp"
10
11namespace fcn
12{
18 class FIFEGUI_API InputEvent : public Event
19 {
20 public:
32 Widget* source,
33 Widget* distributor,
34 bool isShiftPressed,
36 bool isAltPressed,
37 bool isMetaPressed);
38
45 bool isShiftPressed() const;
46
53 bool isControlPressed() const;
54
61 bool isAltPressed() const;
62
69 bool isMetaPressed() const;
70
81 void consume();
82
90 bool isConsumed() const;
91
98 Widget* getDistributor() const;
99
100 protected:
105
110
115
120
126
131
139 friend class Gui;
140 };
141} // namespace fcn
142
143#endif // INCLUDE_FIFECHAN_INPUTEVENT_HPP_
Event(Widget *source)
Constructor.
Definition event.cpp:9
Widget * getDistributor() const
Gets the distributor of the event.
InputEvent(Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed)
Constructor.
friend class Gui
Gui is a friend of this class in order to be able to manipulate the protected member variables of thi...
bool mIsConsumed
True if the input event is consumed, false otherwise.
bool isConsumed() const
Checks if the input event is consumed.
bool isAltPressed() const
Checks if alt is pressed.
bool isControlPressed() const
Checks if control is pressed.
bool isMetaPressed() const
Checks whether meta is pressed.
void consume()
Marks the event as consumed.
bool mControlPressed
True if control is pressed, false otherwise.
bool mAltPressed
True if alt is pressed, false otherwise.
Widget * mDistributor
Holds the distributor of the event.
bool isShiftPressed() const
Checks if shift is pressed.
bool mShiftPressed
True if shift is pressed, false otherwise.
bool mMetaPressed
True if meta is pressed, false otherwise.
Abstract base class defining the common behavior, properties, and lifecycle of all GUI elements.
Definition widget.hpp:45