From 8c245af35cc2ac3666b631be12e1f130bfbad503 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Thu, 9 Feb 2012 01:26:34 -0600 Subject: MAEMO: Define platform global keymap --- backends/platform/maemo/maemo.cpp | 27 +++++++++++++++++++++++++++ backends/platform/maemo/maemo.h | 1 + 2 files changed, 28 insertions(+) (limited to 'backends/platform/maemo') diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp index 24f5d38e5e..eae18cc4fd 100644 --- a/backends/platform/maemo/maemo.cpp +++ b/backends/platform/maemo/maemo.cpp @@ -31,7 +31,9 @@ #include "backends/platform/maemo/maemo-keys.h" #include "backends/events/maemosdl/maemosdl-events.h" #include "backends/graphics/maemosdl/maemosdl-graphics.h" +#include "backends/keymapper/keymapper.h" #include "common/textconsole.h" +#include "common/translation.h" #include @@ -127,6 +129,31 @@ Common::HardwareKeySet *OSystem_SDL_Maemo::getHardwareKeySet() { #endif } +Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() { +#ifdef ENABLE_KEYMAPPER + using namespace Common; + Keymap *globalMap = new Keymap("maemo"); + + Action *act; + +// act = new Action(globalMap, "CLKM", _("Click Mode"), kKeyRemapActionType); +// act->addCustomEvent(CLICK_MODE); + + act = new Action(globalMap, "LCLK", _("Left Click"), kKeyRemapActionType); + act->addLeftClickEvent(); + + act = new Action(globalMap, "MCLK", _("Middle Click"), kKeyRemapActionType); + act->addMiddleClickEvent(); + + act = new Action(globalMap, "RCLK", _("Right Click"), kKeyRemapActionType); + act->addRightClickEvent(); + + return globalMap; +#else + return OSystem_POSIX::getGlobalKeymap(); +#endif +} + } //namespace Maemo diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h index 44b84cd9b5..e94c6c603b 100644 --- a/backends/platform/maemo/maemo.h +++ b/backends/platform/maemo/maemo.h @@ -40,6 +40,7 @@ public: virtual void setWindowCaption(const char *caption); virtual void setupIcon(); virtual Common::HardwareKeySet *getHardwareKeySet(); + virtual Common::Keymap *getGlobalKeymap(); Model getModel() { return _model; } -- cgit v1.2.3