From 596358ffea72aec48b389609349f717e76396ae2 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Mon, 25 Nov 2024 11:17:20 +0100 Subject: button test working --- src/crepe/system/InputSystem.cpp | 31 ++++++++++++++++++++++--------- src/crepe/system/InputSystem.h | 2 +- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'src/crepe/system') diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index 4560411..a3e28e4 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -56,10 +56,6 @@ void InputSystem::update() { if (last_mouse_button == event.mouse_button && std::abs(delta_x) <= click_tolerance && std::abs(delta_y) <= click_tolerance) { - std::cout << "Click registered at (" << event.mouse_position.first - << ", " << event.mouse_position.second << ") with button " - << static_cast(event.mouse_button) << std::endl; - event_mgr.queue_event(MouseClickEvent{ .mouse_x = event.mouse_position.first, .mouse_y = event.mouse_position.second, @@ -67,8 +63,6 @@ void InputSystem::update() { }); this->handle_click(mouse_release_event); - } else { - std::cout << "Mouse release did not register as a click." << std::endl; } break; @@ -101,6 +95,25 @@ void InputSystem::update() { } } +void InputSystem::handle_move(const MouseMoveEvent){ + ComponentManager &mgr = this->component_manager; + + // Get the buttons and transforms + std::vector> buttons = mgr.get_components_by_type