From 71a614e1f87141c4d062a2a466377322fc3d9ff0 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Mon, 18 Nov 2024 15:40:11 +0100 Subject: make format --- src/example/events.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/example') diff --git a/src/example/events.cpp b/src/example/events.cpp index 5a0a748..6431c67 100644 --- a/src/example/events.cpp +++ b/src/example/events.cpp @@ -54,13 +54,13 @@ class MyScript : public Script, public IKeyListener, public IMouseListener { class TestKeyListener : public IKeyListener { public: bool on_key_pressed(const KeyPressEvent & event) override { - std::cout << "TestKeyListener: Key Pressed - Code: " - << static_cast(event.key) << std::endl; + std::cout << "TestKeyListener: Key Pressed - Code: " << static_cast(event.key) + << std::endl; return true; // Return true if the listener should remain active } bool on_key_released(const KeyReleaseEvent & event) override { - std::cout << "TestKeyListener: Key Released - Code: " - << static_cast(event.key) << std::endl; + std::cout << "TestKeyListener: Key Released - Code: " << static_cast(event.key) + << std::endl; return true; } }; @@ -74,10 +74,8 @@ int main() { click_event.mouse_x = 100; click_event.mouse_y = 200; // queue events to test queue - EventManager::get_instance().queue_event( - std::move(key_press), 0); - EventManager::get_instance().queue_event( - std::move(click_event), 0); + EventManager::get_instance().queue_event(std::move(key_press), 0); + EventManager::get_instance().queue_event(std::move(click_event), 0); { TestKeyListener test_listener; test_listener.set_channel(1); @@ -102,8 +100,7 @@ int main() { std::cout << "lambda test" << std::endl; return false; }; - EventManager::get_instance().subscribe( - std::move(event_handler), 0); + EventManager::get_instance().subscribe(std::move(event_handler), 0); // testing trigger with testListener not in scope (unsubscribed) EventManager::get_instance().trigger_event(key_press, 0); EventManager::get_instance().trigger_event(click_event, 0); -- cgit v1.2.3