aboutsummaryrefslogtreecommitdiff
path: root/mwe/events/include/event.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-10-28 11:34:43 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-10-28 11:34:43 +0100
commitf2136f836f9b9e9a6a6698f7bc6fba85a27ebebf (patch)
tree532d11ed8e9e27ff70eaa69fb874311ee60c5e74 /mwe/events/include/event.h
parent29f9a26046e35c7eb0157df92757ce8e39f1ec74 (diff)
iKeyListener test and iMouseListener test working
Diffstat (limited to 'mwe/events/include/event.h')
-rw-r--r--mwe/events/include/event.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/mwe/events/include/event.h b/mwe/events/include/event.h
index 8968c6c..65560a1 100644
--- a/mwe/events/include/event.h
+++ b/mwe/events/include/event.h
@@ -67,15 +67,14 @@ public:
class MouseClickEvent : public Event {
public:
MouseClickEvent(int x, int y, MouseButton button);
-
+
REGISTER_EVENT_TYPE("KeyClickedEvent");
- int getX() const { return x; }
- int getY() const { return y; }
+ std::pair<int, int> getMousePosition() const;
MouseButton getButton() const { return button; }
private:
- int x;
- int y;
+ int mouseX = 0;
+ int mouseY = 0;
MouseButton button;
};
// KeyReleasedEvent class
@@ -147,9 +146,7 @@ public:
REGISTER_EVENT_TYPE(TextSubmitEvent)
- std::string getText() const {
- return text;
- }
+ std::string getText() const;
private:
std::string text;