diff --git a/core/hostevents.cpp b/core/hostevents.cpp index 645316e..0013943 100644 --- a/core/hostevents.cpp +++ b/core/hostevents.cpp @@ -67,4 +67,7 @@ void EventManager::poll_events() unhandled_events++; } } + + // perform post-processing + this->_post_signal.emit(); } diff --git a/core/hostevents.h b/core/hostevents.h index 4e7b749..fc34937 100644 --- a/core/hostevents.h +++ b/core/hostevents.h @@ -71,12 +71,18 @@ public: _mouse_signal.connect_method(inst, func); } + template + void add_post_handler(T *inst, void (T::*func)()) { + _post_signal.connect_method(inst, func); + } + private: static EventManager* event_manager; EventManager() {}; // private constructor to implement a singleton CoreSignal _window_signal; CoreSignal _mouse_signal; + CoreSignal<> _post_signal; uint64_t events_captured = 0; uint64_t unhandled_events = 0;