FifeGUI 0.2.0
A C++ GUI library designed for games.
keyevent.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/keyevent.hpp"
6
7#include "fifechan/inputevent.hpp"
8#include "fifechan/key.hpp"
9
10namespace fcn
11{
13 Widget* source,
14 Widget* distributor,
15 bool isShiftPressed,
17 bool isAltPressed,
18 bool isMetaPressed,
19 Type type,
20 bool isNumericPad,
21 Key const & key) :
23 mType(type),
25 mKey(key)
26 {
27 }
28
30 {
31 return mType;
32 }
33
35 {
36 return mIsNumericPad;
37 }
38
39 Key const & KeyEvent::getKey() const
40 {
41 return mKey;
42 }
43} // 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 getType() const
Gets the type of the event.
Definition keyevent.cpp:29
bool mIsNumericPad
True if the numeric pad was used, false otherwise.
Definition keyevent.hpp:90
Key const & getKey() const
Gets the key of the event.
Definition keyevent.cpp:39
bool isNumericPad() const
Checks if the key event occurred on the numeric pad.
Definition keyevent.cpp:34
KeyEvent(Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed, Type type, bool isNumericPad, Key const &key)
Constructor.
Definition keyevent.cpp:12
Type mType
Holds the type of the key event.
Definition keyevent.hpp:85
Type
Key event types.
Definition keyevent.hpp:28
Key mKey
Holds the key of the key event.
Definition keyevent.hpp:95
Represents a keyboard key or character code.
Definition key.hpp:20
Abstract base class defining the common behavior, properties, and lifecycle of all GUI elements.
Definition widget.hpp:45