aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/InputSystem.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-19 19:06:00 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-19 19:06:00 +0100
commite9ff4f207572a2dd2fb588093c7d1d971e463dc0 (patch)
tree621c74431b2a4042099e3c22beee3f5383ef2cbb /src/crepe/system/InputSystem.h
parentfa3bf171e73da70d964d85851bd20d87362fcfd2 (diff)
parentc737b01035cb62712b1dabcfef6f5014bdc882d1 (diff)
merge master
Diffstat (limited to 'src/crepe/system/InputSystem.h')
-rw-r--r--src/crepe/system/InputSystem.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/crepe/system/InputSystem.h b/src/crepe/system/InputSystem.h
index eefd9fe..e580d8e 100644
--- a/src/crepe/system/InputSystem.h
+++ b/src/crepe/system/InputSystem.h
@@ -3,6 +3,8 @@
#include "../api/Config.h"
#include "../facade/EventData.h"
+#include "../api/Event.h"
+#include "../api/Metadata.h"
#include "../types.h"
#include "../util/OptionalRef.h"
@@ -13,6 +15,37 @@ namespace crepe {
class Camera;
class Button;
class Transform;
+//! Event triggered when a button is clicked
+class ButtonPressEvent : public Event {
+public:
+ //! Metadata of the button.
+ const Metadata & metadata;
+ /**
+ * \param metadata Metadata of the button pressed
+ */
+ ButtonPressEvent(const Metadata & metadata) : metadata(metadata){};
+};
+//! Event triggered when the mouse enters a button
+class ButtonEnterEvent : public Event {
+public:
+ //! Metadata of the button.
+ const Metadata & metadata;
+ /**
+ * \param metadata Metadata of the button pressed
+ */
+ ButtonEnterEvent(const Metadata & metadata) : metadata(metadata){};
+};
+//! Event triggered when the mouse leaves a button
+class ButtonExitEvent : public Event {
+public:
+ //! Metadata of the button.
+ const Metadata & metadata;
+ /**
+ * \param metadata Metadata of the button pressed
+ */
+ ButtonExitEvent(const Metadata & metadata) : metadata(metadata){};
+};
+
/**
* \brief Handles the processing of input events created by SDLContext
*