diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/EventDispatcher.cpp | 11 | ||||
-rw-r--r-- | common/events.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/common/EventDispatcher.cpp b/common/EventDispatcher.cpp index 2650d795b7..b81db6ff19 100644 --- a/common/EventDispatcher.cpp +++ b/common/EventDispatcher.cpp @@ -70,6 +70,17 @@ void EventDispatcher::dispatch() { } } +void EventDispatcher::clearEvents() { + Event event; + + for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) { + while (i->source->pollEvent(event)) {} + } + + List<Event> delayedEvents = _mapper->getDelayedEvents(); +} + + void EventDispatcher::registerMapper(EventMapper *mapper, bool autoFree) { if (_autoFreeMapper) { delete _mapper; diff --git a/common/events.h b/common/events.h index 484564e3db..21a65a642b 100644 --- a/common/events.h +++ b/common/events.h @@ -282,6 +282,12 @@ public: void dispatch(); /** + * Clear all events currently in the event queue. + * The cleared events are not dispatched and are simply discarded. + */ + void clearEvents(); + + /** * Registers an event mapper with the dispatcher. * * The ownership of the "mapper" variable will pass |