diff options
-rw-r--r-- | backends/events/default/default-events.cpp | 16 | ||||
-rw-r--r-- | backends/events/default/default-events.h | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 12bb766cd6..cffc210aaf 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -93,14 +93,18 @@ void writeRecord(Common::OutSaveFile *outFile, uint32 diff, Common::Event &event } DefaultEventManager::DefaultEventManager(Common::EventSource *boss) : - _boss(boss), _buttonState(0), _modifierState(0), _shouldQuit(false), _shouldRTL(false), _confirmExitDialogActive(false) { - assert(_boss); + assert(boss); + + g_eventDispatcher.registerSource(boss, false); + g_eventDispatcher.registerSource(&_artificialEventSource, false); + + g_eventDispatcher.registerObserver(this, 0, false); _recordFile = NULL; _recordTimeFile = NULL; @@ -378,12 +382,12 @@ void DefaultEventManager::processMillis(uint32 &millis) { bool DefaultEventManager::pollEvent(Common::Event &event) { uint32 time = g_system->getMillis(); - bool result; + bool result = false; - if (_artificialEventSource.pollEvent(event)) { + g_eventDispatcher.dispatch(); + if (!_eventQueue.empty()) { + event = _eventQueue.pop(); result = true; - } else { - result = _boss->pollEvent(event); #ifdef ENABLE_KEYMAPPER if (result) { diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index e4c33bc554..b8f47385a8 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -42,8 +42,6 @@ namespace Common { class DefaultEventManager : public Common::EventManager, Common::EventObserver { - Common::EventSource *_boss; - #ifdef ENABLE_VKEYBD Common::VirtualKeyboard *_vk; #endif |