ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::integration::event::Event Struct Reference

Event class. More...

#include <Event.hpp>

Collaboration diagram for ecstasy::integration::event::Event:

Public Types

enum class  Type {
  MouseButtonPressed , MouseButtonReleased , MouseWheelScrolled , MouseMoved ,
  KeyPressed , KeyReleased , TextEntered , GamepadButtonPressed ,
  GamepadButtonReleased , GamepadAxis , GamepadConnected , GamepadDisconnected ,
  Count
}
 Event types. More...
 

Public Member Functions

constexpr Event () noexcept
 Construct an empty event.
 
constexpr Event (MouseButtonEvent &&event) noexcept
 Construct a mouse button event wrapper.
 
constexpr Event (MouseWheelScrollEvent &&event) noexcept
 Construct a mouse wheel scroll event wrapper.
 
constexpr Event (MouseMoveEvent &&event) noexcept
 Construct a mouse move event wrapper.
 
constexpr Event (KeyEvent &&event) noexcept
 Construct a key event wrapper.
 
constexpr Event (TextEnteredEvent &&event) noexcept
 Construct a text entered event wrapper.
 
constexpr Event (GamepadButtonEvent &&event) noexcept
 Construct a gamepad button event wrapper.
 
constexpr Event (GamepadConnectedEvent &&event) noexcept
 Construct a gamepad connected event wrapper.
 
constexpr Event (GamepadAxisEvent &&event) noexcept
 Construct a gamepad axis event wrapper.
 
 ~Event () noexcept=default
 Default desctructor.
 

Public Attributes

Type type
 Type of the event stored.
 
union { 
 
   MouseButtonEvent   mouseButton 
 Type::MouseButtonPressed && Type::MouseButtonReleased associated events. More...
 
   MouseWheelScrollEvent   mouseWheel 
 Type::MouseWheelScrolled associated event. More...
 
   MouseMoveEvent   mouseMove 
 Type::MouseMoved associated event. More...
 
   KeyEvent   key 
 Type::KeyPressed && Type::KeyReleased associated events. More...
 
   TextEnteredEvent   text 
 Type::TextEntered associated event. More...
 
   GamepadButtonEvent   gamepadButton 
 Type::GamepadButtonPressed && Type::GamepadButtonReleased More...
 
   GamepadAxisEvent   gamepadAxis 
 Type::GamepadAxis associated event. More...
 
   GamepadConnectedEvent   gamepadConnected 
 Type::GamepadConnected && Type::GamepadDisconnected associated events. More...
 
};  
 Anonymous union to ease facilitate the wrapped event access.
 

Detailed Description

Event class.

Holds the event type (set to Type::Count if empty) and the associated event struct containing the appropriate data.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 33 of file Event.hpp.

Member Enumeration Documentation

◆ Type

Event types.

Enumerator
MouseButtonPressed 

One of the mouse button has been pressed.

MouseButtonReleased 

One of the mouse button has been released.

MouseWheelScrolled 

The mouse wheel was scrolled.

MouseMoved 

The mouse cursor moved.

KeyPressed 

One of the keyboard key has been pressed.

KeyReleased 

One of the keyboard key has been released.

TextEntered 

A character has been entered.

GamepadButtonPressed 

One of the gamepads button has been pressed.

GamepadButtonReleased 

One of the gamepads button has been released.

GamepadAxis 

One of the gamepads axis value changed.

GamepadConnected 

One gamepad has been connected.

GamepadDisconnected 

One gamepad has been disconnected.

Count 

Keep last – the total number of events.

Definition at line 35 of file Event.hpp.

35 {
48
49 Count
50 };
@ 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.

Constructor & Destructor Documentation

◆ Event() [1/9]

constexpr ecstasy::integration::event::Event::Event ( )
inlineconstexprnoexcept

Construct an empty event.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 58 of file Event.hpp.

58: type(Type::Count){};
Type type
Type of the event stored.
Definition Event.hpp:176

◆ Event() [2/9]

constexpr ecstasy::integration::event::Event::Event ( MouseButtonEvent &&  event)
inlineconstexprnoexcept

Construct a mouse button event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 68 of file Event.hpp.

70 {
71 }
Event integration.
Definition Event.hpp:25
Type
MouseButtonEvent mouseButton
Type::MouseButtonPressed && Type::MouseButtonReleased associated events.
Definition Event.hpp:186

◆ Event() [3/9]

constexpr ecstasy::integration::event::Event::Event ( MouseWheelScrollEvent &&  event)
inlineconstexprnoexcept

Construct a mouse wheel scroll event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 81 of file Event.hpp.

82 {
83 }
MouseWheelScrollEvent mouseWheel
Type::MouseWheelScrolled associated event.
Definition Event.hpp:187

◆ Event() [4/9]

constexpr ecstasy::integration::event::Event::Event ( MouseMoveEvent &&  event)
inlineconstexprnoexcept

Construct a mouse move event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 93 of file Event.hpp.

94 {
95 }
MouseMoveEvent mouseMove
Type::MouseMoved associated event.
Definition Event.hpp:188

◆ Event() [5/9]

constexpr ecstasy::integration::event::Event::Event ( KeyEvent &&  event)
inlineconstexprnoexcept

Construct a key event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 105 of file Event.hpp.

107 {
108 }
KeyEvent key
Type::KeyPressed && Type::KeyReleased associated events.
Definition Event.hpp:189

◆ Event() [6/9]

constexpr ecstasy::integration::event::Event::Event ( TextEnteredEvent &&  event)
inlineconstexprnoexcept

Construct a text entered event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 118 of file Event.hpp.

119 {
120 }
TextEnteredEvent text
Type::TextEntered associated event.
Definition Event.hpp:190

◆ Event() [7/9]

constexpr ecstasy::integration::event::Event::Event ( GamepadButtonEvent &&  event)
inlineconstexprnoexcept

Construct a gamepad button event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 130 of file Event.hpp.

132 {
133 }
GamepadButtonEvent gamepadButton
Type::GamepadButtonPressed && Type::GamepadButtonReleased
Definition Event.hpp:191

◆ Event() [8/9]

constexpr ecstasy::integration::event::Event::Event ( GamepadConnectedEvent &&  event)
inlineconstexprnoexcept

Construct a gamepad connected event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 143 of file Event.hpp.

145 {
146 }
GamepadConnectedEvent gamepadConnected
Type::GamepadConnected && Type::GamepadDisconnected associated events.
Definition Event.hpp:195

◆ Event() [9/9]

constexpr ecstasy::integration::event::Event::Event ( GamepadAxisEvent &&  event)
inlineconstexprnoexcept

Construct a gamepad axis event wrapper.

Parameters
[in]eventSource event.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 156 of file Event.hpp.

157 {
158 }
GamepadAxisEvent gamepadAxis
Type::GamepadAxis associated event.
Definition Event.hpp:193

◆ ~Event()

ecstasy::integration::event::Event::~Event ( )
defaultnoexcept

Default desctructor.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Member Data Documentation

◆ [union]

Anonymous union to ease facilitate the wrapped event access.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

◆ gamepadAxis

GamepadAxisEvent ecstasy::integration::event::Event::gamepadAxis

Type::GamepadAxis associated event.

Definition at line 193 of file Event.hpp.

◆ gamepadButton

GamepadButtonEvent ecstasy::integration::event::Event::gamepadButton

Type::GamepadButtonPressed && Type::GamepadButtonReleased

associated events.

Definition at line 191 of file Event.hpp.

◆ gamepadConnected

GamepadConnectedEvent ecstasy::integration::event::Event::gamepadConnected

Type::GamepadConnected && Type::GamepadDisconnected associated events.

Definition at line 195 of file Event.hpp.

◆ key

KeyEvent ecstasy::integration::event::Event::key

Type::KeyPressed && Type::KeyReleased associated events.

Definition at line 189 of file Event.hpp.

◆ mouseButton

MouseButtonEvent ecstasy::integration::event::Event::mouseButton

Type::MouseButtonPressed && Type::MouseButtonReleased associated events.

Definition at line 186 of file Event.hpp.

◆ mouseMove

MouseMoveEvent ecstasy::integration::event::Event::mouseMove

Type::MouseMoved associated event.

Definition at line 188 of file Event.hpp.

◆ mouseWheel

MouseWheelScrollEvent ecstasy::integration::event::Event::mouseWheel

Type::MouseWheelScrolled associated event.

Definition at line 187 of file Event.hpp.

◆ text

TextEnteredEvent ecstasy::integration::event::Event::text

Type::TextEntered associated event.

Definition at line 190 of file Event.hpp.

◆ type

Type ecstasy::integration::event::Event::type

Type of the event stored.

Note
Type::Count means the event is invalid (empty).
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-06)

Definition at line 176 of file Event.hpp.


The documentation for this struct was generated from the following file: