aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Event.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-24 22:12:31 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-24 22:12:31 +0100
commit24e3f0ea7c5ce90af1276dca49644b5e1ac799f6 (patch)
tree465dd020c1700511a1697267268b3d975caefd48 /src/crepe/api/Event.h
parent6287d4e9068d8bd27a9e62643f54adb69e84befd (diff)
parentbe5ccbe24086d5d4fb407f268c649dcbc36eda6b (diff)
merge
Diffstat (limited to 'src/crepe/api/Event.h')
-rw-r--r--src/crepe/api/Event.h29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/crepe/api/Event.h b/src/crepe/api/Event.h
index ef6a791..bac8701 100644
--- a/src/crepe/api/Event.h
+++ b/src/crepe/api/Event.h
@@ -1,23 +1,24 @@
#pragma once
+// TODO discussing the location of these events
#include <string>
#include "KeyCodes.h"
+namespace crepe {
+
/**
* \brief Base class for all event types in the system.
*/
-class Event {
-public:
-};
+class Event {};
/**
* \brief Event triggered when a key is pressed.
*/
class KeyPressEvent : public Event {
public:
- //! Number of times the key press is repeated (e.g., for long presses).
- int repeat = 0;
+ //! false if first time press, true if key is repeated
+ bool repeat = false;
//! The key that was pressed.
Keycode key = Keycode::NONE;
@@ -96,11 +97,7 @@ public:
/**
* \brief Event triggered during a collision between objects.
*/
-class CollisionEvent : public Event {
-public:
- //! Data describing the collision (currently not implemented).
- // Collision collisionData;
-};
+class CollisionEvent : public Event {};
/**
* \brief Event triggered when text is submitted, e.g., from a text input.
@@ -118,14 +115,4 @@ class ShutDownEvent : public Event {
public:
};
-class MouseScrollEvent : public Event {
-public:
- //! X-coordinate of the mouse position at the time of the event.
- int scroll_x = 0;
-
- //! Y-coordinate of the mouse position at the time of the event.
- int scroll_y = 0;
-
- int direction = 0;
-};
-
+}