aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Event.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Event.h')
-rw-r--r--src/crepe/api/Event.h62
1 files changed, 25 insertions, 37 deletions
diff --git a/src/crepe/api/Event.h b/src/crepe/api/Event.h
index c0de4fc..87c6068 100644
--- a/src/crepe/api/Event.h
+++ b/src/crepe/api/Event.h
@@ -1,68 +1,56 @@
#pragma once
#include <typeindex>
-//#include "keyCodes.h"
-#include <cstdint>
#include <iostream>
#include <string>
-#include <unordered_map>
-#include <variant>
-using Keycode = uint16_t;
-enum class MouseButton {
- NONE = 0,
- LEFT_MOUSE = 1,
- RIGHT_MOUSE = 2,
- MIDDLE_MOUSE = 3,
- X1_MOUSE = 4,
- X2_MOUSE = 5,
- SCROLL_UP = 6,
- SCROLL_DOWN = 7,
-};
+#include "KeyCodes.h"
+
class Event {
public:
-bool handled = false;
+ bool handled = false;
};
class KeyPressEvent : public Event {
public:
- int repeat = 0;
- Keycode key = 0;
+ int repeat = 0;
+ Keycode key = Keycode::None;
};
-class MouseClickEvent : public Event {
-public:
- int mouse_x = 0;
- int mouse_y = 0;
- MouseButton button;
-};
class KeyReleaseEvent : public Event {
public:
- Keycode key = 0;
+ Keycode key = Keycode::None;
};
class MousePressEvent : public Event {
public:
- int mouse_x = 0;
- int mouse_y = 0;
- MouseButton button;
+ int mouse_x = 0;
+ int mouse_y = 0;
+ MouseButton button;
+};
+
+class MouseClickEvent : public Event {
+public:
+ int mouse_x = 0;
+ int mouse_y = 0;
+ MouseButton button;
};
class MouseReleaseEvent : public Event {
public:
- int mouse_x = 0;
- int mouse_y = 0;
- MouseButton button;
+ int mouse_x = 0;
+ int mouse_y = 0;
+ MouseButton button = MouseButton::None;
};
class MouseMoveEvent : public Event {
public:
- int mouse_x = 0;
- int mouse_y = 0;
+ int mouse_x = 0;
+ int mouse_y = 0;
};
-class CollisionEvent : public Event{
+class CollisionEvent : public Event {
public:
- //Collision collisionData;
+ //Collision collisionData;
};
-class TextSubmitEvent : public Event{
+class TextSubmitEvent : public Event {
public:
- std::string text;
+ std::string text;
};
class ShutDownEvent : public Event {
public: