diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-19 09:13:43 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-19 09:13:43 +0100 |
commit | d8f1e161b0c98baa7dde287c484529a8b1291626 (patch) | |
tree | 2f0eb1c7175375eac6efbf6d1e847d51bcd257cd /src/crepe/system/InputSystem.h | |
parent | a6ba1eb5b6b6a1782182008e0044bf1ac04733dc (diff) | |
parent | 7c76d1743d5b0c3cf6eb05076fae88e948f3e22f (diff) |
Merge branch 'wouter/button-improvement' of github.com:lonkaars/crepe
Diffstat (limited to 'src/crepe/system/InputSystem.h')
-rw-r--r-- | src/crepe/system/InputSystem.h | 33 |
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 * |