From ab69e41cabd6f5a84ebb2e2629d194b49b7039de Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 13 Nov 2024 12:22:17 +0100 Subject: added some extra comments --- src/crepe/api/EventHandler.h | 2 +- src/example/events.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/crepe/api/EventHandler.h b/src/crepe/api/EventHandler.h index 5b9ac0d..dc06806 100644 --- a/src/crepe/api/EventHandler.h +++ b/src/crepe/api/EventHandler.h @@ -8,7 +8,7 @@ * \brief A type alias for an event handler function. * * The EventHandler is a std::function that takes an EventType reference and returns a boolean value - * indicating whether the event was successfully handled. + * indicating whether the event is handled. * * \tparam EventType The type of event this handler will handle. */ diff --git a/src/example/events.cpp b/src/example/events.cpp index 1a29d80..af5f747 100644 --- a/src/example/events.cpp +++ b/src/example/events.cpp @@ -91,13 +91,12 @@ int main() { return false; }; 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); + // dispatching queued events EventManager::get_instance().dispatch_events(); - + EventManager::get_instance().unsubscribe(event_handler,0); return EXIT_SUCCESS; } -- cgit v1.2.3