diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-20 18:48:18 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-20 18:48:18 +0100 |
commit | 9f882131f09410113d757d96e5aa0322aa5584bd (patch) | |
tree | 9ee5d3b3b8e83f3281797ec4c9c4be47dd603848 /src/example/events.cpp | |
parent | 9a46acde813e00e574e70439795dedcdc9a8192a (diff) |
git remake
Diffstat (limited to 'src/example/events.cpp')
-rw-r--r-- | src/example/events.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/example/events.cpp b/src/example/events.cpp index 402a857..3dee9fa 100644 --- a/src/example/events.cpp +++ b/src/example/events.cpp @@ -63,9 +63,9 @@ public: } }; int main() { - + { - // two events to trigger + // two events to trigger KeyPressEvent key_press; key_press.key = Keycode::A; key_press.repeat = 0; @@ -106,10 +106,8 @@ int main() { EventManager::get_instance().subscribe<KeyPressEvent>(event_handler, CHANNEL_ALL); EventManager::get_instance().subscribe<KeyPressEvent>(event_handler, CHANNEL_ALL); EventManager::get_instance().subscribe<MouseClickEvent>(event_handler2, CHANNEL_ALL); - EventManager::get_instance().trigger_event<KeyPressEvent>(KeyPressEvent{ - .repeat = false, - .key = Keycode::A - }); + EventManager::get_instance().trigger_event<KeyPressEvent>( + KeyPressEvent{.repeat = false, .key = Keycode::A}); //EventManager::get_instance().unsubscribe<KeyPressEvent>(event_handler, 0); // testing trigger with testListener not in scope (unsubscribed) // EventManager::get_instance().trigger_event<KeyPressEvent>(key_press, 0); |