Aether
SDL2 based UI Framework for NX
InputEvent.hpp
1 #ifndef AETHER_EVENT_HPP
2 #define AETHER_EVENT_HPP
3 
4 #include <SDL2/SDL.h>
5 #include "Aether/utils/Types.hpp"
6 
7 namespace Aether {
11  enum EventType {
17  };
18 
25  class InputEvent {
26  private:
28  EventType type_;
30  Button button_;
32  int id_;
34  int touchX_;
36  int touchY_;
38  int touchDX_;
40  int touchDY_;
41 
42  public:
48  InputEvent(SDL_Event event);
49 
55  EventType type();
56 
62  Button button();
63 
69  int id();
70 
76  int touchX();
77 
83  int touchY();
84 
90  int touchDX();
91 
97  int touchDY();
98 
102  ~InputEvent();
103  };
104 };
105 
106 #endif
EventType
Enum class that contains all events types supported by Aether for handling.
Definition: InputEvent.hpp:11
EventType type()
Getter function to get event type.
Definition: InputEvent.hpp:16
int touchDX()
Getter function to get the change of horizontal position for a touch move event.
Definition: InputEvent.hpp:15
int touchX()
Getter function to get the horizontal position for a touch event.
Definition: InputEvent.hpp:13
Base namespace for all Aether related classes and functions.
A class that represents an Aether input event.
Definition: InputEvent.hpp:25
Button button()
Getter function to get button information for event.
int touchDY()
Getter function to get the change of vertical position for a touch move event.
int touchY()
Getter function to get the vertical position for a touch event.
InputEvent(SDL_Event event)
Construct a new Input Event object from a SDL_Event.
Button
Enum class for buttons Avoids confusion with SDL/libnx names.
Definition: Types.hpp:12
Definition: InputEvent.hpp:12
Definition: InputEvent.hpp:14
int id()
Getter function to get event id.
~InputEvent()
Destroy the Input Event object.