KEYMAPPER: Create a DefaultEventMapper when Keymapper isn't enabled

This allows migration to unconditional mapping
This commit is contained in:
Tarek Soliman 2012-02-17 14:42:17 -06:00
parent e7ade8ae05
commit 5c3e48fddf
2 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,8 @@ DefaultEventManager::DefaultEventManager(Common::EventSource *boss) :
// EventDispatcher will automatically free the keymapper
_dispatcher.registerMapper(_keymapper);
_remap = false;
#else
_dispatcher.registerMapper(new Common::DefaultEventMapper());
#endif
}

View File

@ -219,6 +219,11 @@ public:
bool allowMapping() const { return false; }
};
class DefaultEventMapper : public EventMapper, private ArtificialEventSource {
bool notifyEvent(const Event &ev) { ArtificialEventSource::addEvent(Event(ev)); return true; }
bool pollEvent(Event &ev) { return ArtificialEventSource::pollEvent(ev); }
};
/**
* Dispatches events from various sources to various observers.
*