Lugdunum  0.1.0
Event.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <vector>
5 
6 #include <lug/Window/Export.hpp>
8 #include <lug/Window/Mouse.hpp>
9 #include <lug/Math/Vector.hpp>
10 
11 namespace lug {
12 namespace Window {
13 
19  bool alt;
20  bool ctrl;
21  bool shift;
22  bool system;
23 };
24 
29 
30  union {
32 
33  struct {
34  double xOffset;
35  double yOffset;
36  } scrollOffset;
37  };
38 
39  struct {
40  int32_t x;
41  int32_t y;
42  } coord;
43 
44  bool ctrl;
45  bool shift;
46  bool left;
47  bool right;
48  bool middle;
49  bool x1;
50  bool x2;
51 };
52 
54  lug::Math::Vec2f axisLeft;
55  lug::Math::Vec2f axisRight;
56 };
57 
59  lug::Math::Vec2f coordinates[2];
60 
65  enum class LUG_WINDOW_API GestureState : int32_t {
66  None = 0,
67  Start = 1,
68  Move = 2,
69  End = 4,
70  Action = Start | End,
71  };
72 
74  bool drag;
75  bool pinch;
76  bool doubleTap;
77 };
78 
83  wchar_t val;
84 };
85 
93  enum class LUG_WINDOW_API Type : uint32_t {
94  Close,
95  Destroy,
96  Resize,
97  KeyPressed,
98  KeyReleased,
99  CharEntered,
100  ButtonPressed,
101  ButtonReleased,
102  MouseMoved,
103  MouseWheel,
104  MouseLeave,
105  MouseEnter,
106  GamePadChange,
107  TouchScreenChange
108  };
109 
111 
115  union {
121  };
122 };
123 
124 } // Window
125 } // lug
Represents an event.
Definition: Event.hpp:89
Represents a keyboard event.
Definition: Event.hpp:17
bool left
True if left mouse button was pressed, False otherwise.
Definition: Event.hpp:46
Key
Abstraction of keyboard keys.
Definition: Keyboard.hpp:23
Button
Abstraction of Mouse buttons.
Definition: Mouse.hpp:26
lug::Math::Vec2f axisLeft
Definition: Event.hpp:54
bool middle
True if middle mouse button was pressed, False otherwise.
Definition: Event.hpp:48
Type type
The type of the event.
Definition: Event.hpp:110
Keyboard::Key code
The key that triggered the event.
Definition: Event.hpp:18
bool ctrl
True if ctrl was pressed, False otherwise.
Definition: Event.hpp:44
Mouse::Button code
The button that triggered the event.
Definition: Event.hpp:31
bool ctrl
True if ctrl was pressed, False otherwise.
Definition: Event.hpp:20
bool shift
True if shift was pressed, False otherwise.
Definition: Event.hpp:45
bool alt
True if alt was pressed, False otherwise.
Definition: Event.hpp:19
lug::Math::Vec2f axisRight
Definition: Event.hpp:55
bool doubleTap
True if a double tap event occured, False otherwise.
Definition: Event.hpp:76
bool x2
True if extra 2 mouse button was pressed, False otherwise.
Definition: Event.hpp:50
#define LUG_WINDOW_API
Definition: Export.hpp:11
Represents a mouse event.
Definition: Event.hpp:28
TouchScreenEvent touchScreen
Definition: Event.hpp:120
bool x1
True if extra 1 mouse button was pressed, False otherwise.
Definition: Event.hpp:49
CharEvent character
A CharEvent.
Definition: Event.hpp:117
KeyEvent key
A KeyEvent.
Definition: Event.hpp:116
bool right
True if right mouse button was pressed, False otherwise.
Definition: Event.hpp:47
wchar_t val
Raw value of the character pressed (with accents, etc.)
Definition: Event.hpp:83
bool pinch
True if a pinch event occured, False otherwise.
Definition: Event.hpp:75
Represents a char event.
Definition: Event.hpp:82
bool shift
True if shift was pressed, False otherwise.
Definition: Event.hpp:21
bool system
True if system was pressed, False otherwise.
Definition: Event.hpp:22
MouseEvent mouse
A MouseEvent.
Definition: Event.hpp:118
GamePadEvent gamePad
Definition: Event.hpp:119