diff options
Diffstat (limited to 'backends/platform/maemo/maemo.cpp')
-rw-r--r-- | backends/platform/maemo/maemo.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp index eae18cc4fd..fe60bdc042 100644 --- a/backends/platform/maemo/maemo.cpp +++ b/backends/platform/maemo/maemo.cpp @@ -46,6 +46,10 @@ OSystem_SDL_Maemo::OSystem_SDL_Maemo() OSystem_POSIX() { } +OSystem_SDL_Maemo::~OSystem_SDL_Maemo() { + delete _eventObserver; +} + void OSystem_SDL_Maemo::initBackend() { // Create the events manager if (_eventSource == 0) @@ -54,12 +58,16 @@ void OSystem_SDL_Maemo::initBackend() { if (_graphicsManager == 0) _graphicsManager = new MaemoSdlGraphicsManager(_eventSource); + if (_eventObserver == 0) + _eventObserver = new MaemoSdlEventObserver((MaemoSdlEventSource *)_eventSource); + ConfMan.set("vkeybdpath", DATA_PATH); _model = Model(detectModel()); // Call parent implementation of this method OSystem_POSIX::initBackend(); + initObserver(); } void OSystem_SDL_Maemo::quit() { @@ -136,8 +144,11 @@ Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() { Action *act; -// act = new Action(globalMap, "CLKM", _("Click Mode"), kKeyRemapActionType); -// act->addCustomEvent(CLICK_MODE); + act = new Action(globalMap, "CLKM", _("Click Mode"), kKeyRemapActionType); + Event evt = Event(); + evt.type = EVENT_CUSTOM_BACKEND; + evt.customType = Maemo::kEventClickMode; + act->addEvent(evt); act = new Action(globalMap, "LCLK", _("Left Click"), kKeyRemapActionType); act->addLeftClickEvent(); @@ -154,8 +165,11 @@ Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() { #endif } -} //namespace Maemo - +void OSystem_SDL_Maemo::initObserver() { + assert(_eventManager); + _eventManager->getEventDispatcher()->registerObserver(_eventObserver, 10, false); +} +} //namespace Maemo #endif |