aboutsummaryrefslogtreecommitdiffstats
path: root/src/input.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.hpp')
-rw-r--r--src/input.hpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/input.hpp b/src/input.hpp
index 6180388..8f7aa8f 100644
--- a/src/input.hpp
+++ b/src/input.hpp
@@ -33,7 +33,7 @@ struct KeyUpEvent
SDL_Keycode sym;
Uint16 mod;
- KeyUpEvent(const SDL_Keysym& keysym) :
+ explicit KeyUpEvent(const SDL_Keysym& keysym) :
sym(keysym.sym), mod(keysym.mod) {}
};
@@ -45,10 +45,28 @@ struct KeyDownEvent {
SDL_Keycode sym;
Uint16 mod;
- KeyDownEvent(const SDL_Keysym& keysym) :
+ explicit KeyDownEvent(const SDL_Keysym& keysym) :
sym(keysym.sym), mod(keysym.mod) {}
};
+struct MouseUpEvent {
+ Uint8 button;
+ Sint32 x;
+ Sint32 y;
+
+ explicit MouseUpEvent(const SDL_MouseButtonEvent& mbe) :
+ button(mbe.button), x(mbe.x), y(mbe.y) {}
+};
+
+struct MouseDownEvent {
+ Uint8 button;
+ Sint32 x;
+ Sint32 y;
+
+ explicit MouseDownEvent(const SDL_MouseButtonEvent& mbe) :
+ button(mbe.button), x(mbe.x), y(mbe.y) {}
+};
+
/**
* @class InputSystem
* Listens for user input from SDL, and emits input events accordingly.