diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-10-28 11:34:43 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-10-28 11:34:43 +0100 |
commit | f2136f836f9b9e9a6a6698f7bc6fba85a27ebebf (patch) | |
tree | 532d11ed8e9e27ff70eaa69fb874311ee60c5e74 /mwe/events/src/event.cpp | |
parent | 29f9a26046e35c7eb0157df92757ce8e39f1ec74 (diff) |
iKeyListener test and iMouseListener test working
Diffstat (limited to 'mwe/events/src/event.cpp')
-rw-r--r-- | mwe/events/src/event.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/mwe/events/src/event.cpp b/mwe/events/src/event.cpp index 2509088..fc8eec9 100644 --- a/mwe/events/src/event.cpp +++ b/mwe/events/src/event.cpp @@ -53,10 +53,28 @@ Collision CollisionEvent::getCollisionData() const return this->collisionData; } -TextSubmitEvent::TextSubmitEvent(std::string text) : Event("TextSubmitEvent"){ +TextSubmitEvent::TextSubmitEvent(std::string text) + : text(text), Event("TextSubmitEvent") {} +std::string TextSubmitEvent::getText() const { + return this->text; } -std::string TextSubmitEvent::getText() const{ - return this->text; + +MouseReleasedEvent::MouseReleasedEvent(int x, int y, MouseButton button) : mouseX(x), mouseY(y), button(button),Event("MouseReleased"){ + +} +std::pair<int, int> MouseReleasedEvent::getMousePosition() const{ + return {mouseX,mouseY}; +} +MouseClickEvent::MouseClickEvent(int x,int y,MouseButton button) : mouseX(x), mouseY(y), button(button),Event("MouseClickEvent"){ + } +MouseMovedEvent::MouseMovedEvent(int x, int y) : mouseX(x), mouseY(y),Event("MouseMovedEvent"){ +} +std::pair<int, int> MouseClickEvent::getMousePosition() const { + return {mouseX, mouseY}; +} +std::pair<int, int> MouseMovedEvent::getMousePosition() const { + return {mouseX, mouseY}; +} |