diff options
Diffstat (limited to 'mwe/events/include/event.h')
-rw-r--r-- | mwe/events/include/event.h | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/mwe/events/include/event.h b/mwe/events/include/event.h index 730ee4b..62d8974 100644 --- a/mwe/events/include/event.h +++ b/mwe/events/include/event.h @@ -6,7 +6,8 @@ #include <string> #include <unordered_map> #include <variant> - +#include "keyCodes.h" +#include "customTypes.h" class UUIDGenerator { public: static std::uint32_t getUniqueID() { @@ -63,7 +64,19 @@ public: Keycode key = 0; int repeatCount = 0; }; +class MouseClickEvent : public Event { +public: + MouseClickEvent(int x, int y, MouseButton button); + + REGISTER_EVENT_TYPE("KeyClickedEvent"); + std::pair<int, int> getMousePosition() const; + MouseButton getButton() const { return button; } +private: + int mouseX = 0; + int mouseY = 0; + MouseButton button; +}; // KeyReleasedEvent class class KeyReleasedEvent : public Event { public: @@ -89,6 +102,31 @@ public: private: int mouseX = 0; int mouseY = 0; + MouseButton button; +}; +class MouseReleasedEvent : public Event { +public: + MouseReleasedEvent(int mouseX, int mouseY, MouseButton button); + + REGISTER_EVENT_TYPE(MouseReleasedEvent) + + std::pair<int, int> getMousePosition() const; + MouseButton getMouseButton() const; +private: + int mouseX = 0; + int mouseY = 0; + MouseButton button; +}; +class MouseMovedEvent : public Event { +public: + MouseMovedEvent(int mouseX, int mouseY); + + REGISTER_EVENT_TYPE(MouseMovedEvent) + + std::pair<int, int> getMousePosition() const; +private: + int mouseX = 0; + int mouseY = 0; }; class CollisionEvent : public Event { public: @@ -101,3 +139,33 @@ public: private: Collision collisionData; }; +class TextSubmitEvent : public Event { +public: + TextSubmitEvent(std::string submittedText); + + REGISTER_EVENT_TYPE(TextSubmitEvent) + + std::string getText() const; + +private: + std::string text; +}; +class ShutDownEvent : public Event { +public: + ShutDownEvent() : Event("ShutDownEvent"){}; + + REGISTER_EVENT_TYPE(ShutDownEvent) + +private: +}; +// class ButtonClickEvent : public Event { +// public: +// ButtonClickEvent(int x,int y,int width,int height); + +// REGISTER_EVENT_TYPE(TextSubmitEvent) + +// std::string getText() const; + +// private: +// std::string text; +// }; |