FifeGUI
0.2.0
A C++ GUI library designed for games.
fifechan
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
11
namespace
fcn
12
{
18
class
FIFEGUI_API
InputEvent
:
public
Event
19
{
20
public
:
31
InputEvent
(
32
Widget
* source,
33
Widget
* distributor,
34
bool
isShiftPressed
,
35
bool
isControlPressed
,
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
:
104
bool
mShiftPressed
;
105
109
bool
mControlPressed
;
110
114
bool
mAltPressed
;
115
119
bool
mMetaPressed
;
120
125
bool
mIsConsumed
;
126
130
Widget
*
mDistributor
;
131
139
friend
class
Gui
;
140
};
141
}
// namespace fcn
142
143
#endif
// INCLUDE_FIFECHAN_INPUTEVENT_HPP_
fcn::Event::Event
Event(Widget *source)
Constructor.
Definition
event.cpp:9
fcn::InputEvent::getDistributor
Widget * getDistributor() const
Gets the distributor of the event.
Definition
inputevent.cpp:58
fcn::InputEvent::InputEvent
InputEvent(Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed)
Constructor.
Definition
inputevent.cpp:11
fcn::InputEvent::Gui
friend class Gui
Gui is a friend of this class in order to be able to manipulate the protected member variables of thi...
Definition
inputevent.hpp:139
fcn::InputEvent::mIsConsumed
bool mIsConsumed
True if the input event is consumed, false otherwise.
Definition
inputevent.hpp:125
fcn::InputEvent::isConsumed
bool isConsumed() const
Checks if the input event is consumed.
Definition
inputevent.cpp:53
fcn::InputEvent::isAltPressed
bool isAltPressed() const
Checks if alt is pressed.
Definition
inputevent.cpp:38
fcn::InputEvent::isControlPressed
bool isControlPressed() const
Checks if control is pressed.
Definition
inputevent.cpp:33
fcn::InputEvent::isMetaPressed
bool isMetaPressed() const
Checks whether meta is pressed.
Definition
inputevent.cpp:43
fcn::InputEvent::consume
void consume()
Marks the event as consumed.
Definition
inputevent.cpp:48
fcn::InputEvent::mControlPressed
bool mControlPressed
True if control is pressed, false otherwise.
Definition
inputevent.hpp:109
fcn::InputEvent::mAltPressed
bool mAltPressed
True if alt is pressed, false otherwise.
Definition
inputevent.hpp:114
fcn::InputEvent::mDistributor
Widget * mDistributor
Holds the distributor of the event.
Definition
inputevent.hpp:130
fcn::InputEvent::isShiftPressed
bool isShiftPressed() const
Checks if shift is pressed.
Definition
inputevent.cpp:28
fcn::InputEvent::mShiftPressed
bool mShiftPressed
True if shift is pressed, false otherwise.
Definition
inputevent.hpp:104
fcn::InputEvent::mMetaPressed
bool mMetaPressed
True if meta is pressed, false otherwise.
Definition
inputevent.hpp:119
fcn::Widget
Abstract base class defining the common behavior, properties, and lifecycle of all GUI elements.
Definition
widget.hpp:45
Generated by
1.16.1