aboutsummaryrefslogtreecommitdiff
path: root/mwe/events/src/event.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-04 08:31:05 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-04 08:31:05 +0100
commit63d50eea4e389e73e26f41452829dd48e6190c70 (patch)
tree82a8ef7a28fe7e069dbe9830adc28fd49dd85846 /mwe/events/src/event.cpp
parent06f65659fc6ffde7cabd2135040cbfbf089e5a24 (diff)
parent2585dc3cab48ccad0cfa0c63354662d656c86c46 (diff)
Merge branch 'master' of github.com:lonkaars/crepe
Diffstat (limited to 'mwe/events/src/event.cpp')
-rw-r--r--mwe/events/src/event.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/mwe/events/src/event.cpp b/mwe/events/src/event.cpp
index c9201d0..0c9f3ed 100644
--- a/mwe/events/src/event.cpp
+++ b/mwe/events/src/event.cpp
@@ -50,3 +50,24 @@ CollisionEvent::CollisionEvent(Collision collision)
Collision CollisionEvent::getCollisionData() const {
return this->collisionData;
}
+
+TextSubmitEvent::TextSubmitEvent(std::string text)
+ : text(text), Event("TextSubmitEvent") {}
+
+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};
+}