ECSTASY
All in the name
Loading...
Searching...
No Matches
Event.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_INTEGRATION_EVENT_EVENTS_EVENT_HPP_
13#define ECSTASY_INTEGRATION_EVENT_EVENTS_EVENT_HPP_
14
15#include "GamepadAxisEvent.hpp"
18#include "KeyEvent.hpp"
19#include "MouseButtonEvent.hpp"
20#include "MouseMoveEvent.hpp"
22#include "TextEnteredEvent.hpp"
23
25{
33 struct Event {
35 enum class Type {
48
49 Count
50 };
51
58 constexpr Event() noexcept : type(Type::Count){};
59
68 constexpr Event(MouseButtonEvent &&event) noexcept
70 {
71 }
72
82 {
83 }
84
94 {
95 }
96
105 constexpr Event(KeyEvent &&event) noexcept
107 {
108 }
109
119 {
120 }
121
130 constexpr Event(GamepadButtonEvent &&event) noexcept
132 {
133 }
134
143 constexpr Event(GamepadConnectedEvent &&event) noexcept
145 {
146 }
147
157 {
158 }
159
166 ~Event() noexcept = default;
167
177
184 union {
196 };
197 };
198} // namespace ecstasy::integration::event
199
200#endif /* !ECSTASY_INTEGRATION_EVENT_EVENTS_EVENT_HPP_ */
Event integration.
Definition Event.hpp:25
GamepadAxisEvent gamepadAxis
Type::GamepadAxis associated event.
Definition Event.hpp:193
constexpr Event(MouseWheelScrollEvent &&event) noexcept
Construct a mouse wheel scroll event wrapper.
Definition Event.hpp:81
constexpr Event(GamepadButtonEvent &&event) noexcept
Construct a gamepad button event wrapper.
Definition Event.hpp:130
KeyEvent key
Type::KeyPressed && Type::KeyReleased associated events.
Definition Event.hpp:189
~Event() noexcept=default
Default desctructor.
constexpr Event(GamepadConnectedEvent &&event) noexcept
Construct a gamepad connected event wrapper.
Definition Event.hpp:143
@ KeyReleased
One of the keyboard key has been released.
@ MouseButtonPressed
One of the mouse button has been pressed.
@ MouseButtonReleased
One of the mouse button has been released.
@ TextEntered
A character has been entered.
@ MouseWheelScrolled
The mouse wheel was scrolled.
@ GamepadAxis
One of the gamepads axis value changed.
@ KeyPressed
One of the keyboard key has been pressed.
@ GamepadDisconnected
One gamepad has been disconnected.
@ MouseMoved
The mouse cursor moved.
@ GamepadConnected
One gamepad has been connected.
@ GamepadButtonPressed
One of the gamepads button has been pressed.
@ Count
Keep last – the total number of events.
@ GamepadButtonReleased
One of the gamepads button has been released.
GamepadButtonEvent gamepadButton
Type::GamepadButtonPressed && Type::GamepadButtonReleased
Definition Event.hpp:191
constexpr Event(GamepadAxisEvent &&event) noexcept
Construct a gamepad axis event wrapper.
Definition Event.hpp:156
TextEnteredEvent text
Type::TextEntered associated event.
Definition Event.hpp:190
MouseButtonEvent mouseButton
Type::MouseButtonPressed && Type::MouseButtonReleased associated events.
Definition Event.hpp:186
Type type
Type of the event stored.
Definition Event.hpp:176
constexpr Event() noexcept
Construct an empty event.
Definition Event.hpp:58
MouseMoveEvent mouseMove
Type::MouseMoved associated event.
Definition Event.hpp:188
constexpr Event(TextEnteredEvent &&event) noexcept
Construct a text entered event wrapper.
Definition Event.hpp:118
constexpr Event(KeyEvent &&event) noexcept
Construct a key event wrapper.
Definition Event.hpp:105
MouseWheelScrollEvent mouseWheel
Type::MouseWheelScrolled associated event.
Definition Event.hpp:187
GamepadConnectedEvent gamepadConnected
Type::GamepadConnected && Type::GamepadDisconnected associated events.
Definition Event.hpp:195
constexpr Event(MouseMoveEvent &&event) noexcept
Construct a mouse move event wrapper.
Definition Event.hpp:93
constexpr Event(MouseButtonEvent &&event) noexcept
Construct a mouse button event wrapper.
Definition Event.hpp:68
Event describing a gamepad axis value change.
Event describing a gamepad button pressed or released.
Event describing a gamepad connection or disconnection.
Event describing a key pressed or released.
Definition KeyEvent.hpp:25
Event describing when a mouse button is pressed or released.
Event describing when the mouse move.
Event describing when a mouse wheel is scrolled.
Event describing a text (character) entered.