FifeGUI 0.2.0
A C++ GUI library designed for games.
inputevent.cpp
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#include "fifechan/inputevent.hpp"
6
7#include "fifechan/event.hpp"
8
9namespace fcn
10{
12 Widget* source,
13 Widget* distributor,
14 bool isShiftPressed,
16 bool isAltPressed,
17 bool isMetaPressed) :
18 Event(source),
23 mIsConsumed(false),
24 mDistributor(distributor)
25 {
26 }
27
29 {
30 return mShiftPressed;
31 }
32
34 {
35 return mControlPressed;
36 }
37
39 {
40 return mAltPressed;
41 }
42
44 {
45 return mMetaPressed;
46 }
47
49 {
50 mIsConsumed = true;
51 }
52
54 {
55 return mIsConsumed;
56 }
57
59 {
60 return mDistributor;
61 }
62} // namespace fcn
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.
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