diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/keymapper/keymapper.cpp | 18 | ||||
-rw-r--r-- | backends/keymapper/keymapper.h | 6 |
2 files changed, 21 insertions, 3 deletions
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp index 1c83bb877e..cda34ff052 100644 --- a/backends/keymapper/keymapper.cpp +++ b/backends/keymapper/keymapper.cpp @@ -181,12 +181,24 @@ void Keymapper::popKeymap(const char *name) { } bool Keymapper::notifyEvent(const Common::Event &ev) { + bool mapped = false; + if (ev.type == Common::EVENT_KEYDOWN) - return mapKeyDown(ev.kbd); + mapped = mapKeyDown(ev.kbd); else if (ev.type == Common::EVENT_KEYUP) - return mapKeyUp(ev.kbd); + mapped = mapKeyUp(ev.kbd); + + if (mapped) + return true; else - return false; + return mapEvent(ev); +} + +bool Keymapper::mapEvent(const Common::Event &ev) { + // pass through - copy the event + Event evt = ev; + addEvent(evt); + return true; } bool Keymapper::mapKeyDown(const KeyState& key) { diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h index 27e981923b..626df013ac 100644 --- a/backends/keymapper/keymapper.h +++ b/backends/keymapper/keymapper.h @@ -164,6 +164,12 @@ public: bool mapKeyUp(const KeyState& key); /** + * Map non-key incoming events + * @param ev incoming event + */ + bool mapEvent(const Common::Event &ev); + + /** * Enable/disable the keymapper */ void setEnabled(bool enabled) { _enabled = enabled; } |