From 6287d4e9068d8bd27a9e62643f54adb69e84befd Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Sun, 24 Nov 2024 22:08:49 +0100 Subject: input facade --- src/crepe/system/InputSystem.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/crepe/system/InputSystem.h') 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 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); -- cgit v1.2.3