diff options
Diffstat (limited to 'src/crepe/system/InputSystem.h')
-rw-r--r-- | src/crepe/system/InputSystem.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/crepe/system/InputSystem.h b/src/crepe/system/InputSystem.h new file mode 100644 index 0000000..231aa45 --- /dev/null +++ b/src/crepe/system/InputSystem.h @@ -0,0 +1,23 @@ +#pragma once + +#include "System.h" +#include "../api/Event.h" +namespace crepe { + +class InputSystem : public System { +public: + using System::System; + 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); + bool handle_key_release(const KeyReleaseEvent &event); +}; + +} // namespace crepe |