aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/InputSystem.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-24 22:08:49 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-24 22:08:49 +0100
commit6287d4e9068d8bd27a9e62643f54adb69e84befd (patch)
tree2e94d4cda12cd6b0b3b9c33312156000120eb633 /src/crepe/system/InputSystem.h
parent6c2fc3716c9c6c68e982b243af5f7ed04fb35e86 (diff)
input facade
Diffstat (limited to 'src/crepe/system/InputSystem.h')
-rw-r--r--src/crepe/system/InputSystem.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/crepe/system/InputSystem.h b/src/crepe/system/InputSystem.h
index c50d928..231aa45 100644
--- a/src/crepe/system/InputSystem.h
+++ b/src/crepe/system/InputSystem.h
@@ -7,8 +7,13 @@ namespace crepe {
class InputSystem : public System {
public:
using System::System;
- InputSystem(ComponentManager & component_manager);
void update() override;
+ void process_events();
+
+private:
+ std::pair<int, int> last_mouse_down_position{-1, -1};
+ MouseButton last_mouse_button = MouseButton::NONE;
+ const int click_tolerance = 5;
bool handle_click(const MouseClickEvent &event);
bool handle_move(const MouseMoveEvent &event);
bool handle_key_press(const KeyPressEvent &event);