diff options
author | Tarek Soliman | 2011-08-26 17:22:23 -0500 |
---|---|---|
committer | Tarek Soliman | 2011-09-22 22:07:45 -0500 |
commit | 912a04053432bd344629f0ff4da8404cfcd4e2e0 (patch) | |
tree | 47b6774b1a2469687b780a590087ad31d75e1ab9 | |
parent | e04a8fdc3a0cf0c562242344717fc6b67903829d (diff) | |
download | scummvm-rg350-912a04053432bd344629f0ff4da8404cfcd4e2e0.tar.gz scummvm-rg350-912a04053432bd344629f0ff4da8404cfcd4e2e0.tar.bz2 scummvm-rg350-912a04053432bd344629f0ff4da8404cfcd4e2e0.zip |
MAEMO: Zoom- is now mode selector for clicking
-rw-r--r-- | backends/events/maemosdl/maemosdl-events.cpp | 31 | ||||
-rw-r--r-- | backends/events/maemosdl/maemosdl-events.h | 6 |
2 files changed, 32 insertions, 5 deletions
diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp index 14f8382fbe..3001f5d790 100644 --- a/backends/events/maemosdl/maemosdl-events.cpp +++ b/backends/events/maemosdl/maemosdl-events.cpp @@ -26,6 +26,10 @@ #include "backends/events/maemosdl/maemosdl-events.h" +MaemoSdlEventSource::MaemoSdlEventSource() : SdlEventSource(), _clickEnabled(true) { + +} + bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { // List of special N810 keys: @@ -47,8 +51,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { processMouseEvent(event, _km.x, _km.y); return true; } else if (ev.key.keysym.sym == SDLK_F8) { - event.type = Common::EVENT_MBUTTONDOWN; - processMouseEvent(event, _km.x, _km.y); + // handled in keyup return true; } break; @@ -68,16 +71,34 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { processMouseEvent(event, _km.x, _km.y); return true; } else if (ev.key.keysym.sym == SDLK_F8) { - event.type = Common::EVENT_MBUTTONUP; - processMouseEvent(event, _km.x, _km.y); + _clickEnabled = !_clickEnabled; return true; } break; } } - // Invoke parent implementation of this method return SdlEventSource::remapKey(ev, event); } +bool MaemoSdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) { + + if (ev.button.button == SDL_BUTTON_LEFT && !_clickEnabled) { + return false; + } + + // Invoke parent implementation of this method + return SdlEventSource::handleMouseButtonDown(ev, event); +} + +bool MaemoSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) { + + if (ev.button.button == SDL_BUTTON_LEFT && !_clickEnabled) { + return false; + } + + // Invoke parent implementation of this method + return SdlEventSource::handleMouseButtonUp(ev, event); +} + #endif diff --git a/backends/events/maemosdl/maemosdl-events.h b/backends/events/maemosdl/maemosdl-events.h index bdfee0f258..6b41b3c3f3 100644 --- a/backends/events/maemosdl/maemosdl-events.h +++ b/backends/events/maemosdl/maemosdl-events.h @@ -33,8 +33,14 @@ * SDL events manager for Maemo */ class MaemoSdlEventSource : public SdlEventSource { +public: + MaemoSdlEventSource(); protected: virtual bool remapKey(SDL_Event &ev, Common::Event &event); + virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); + virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event); + + bool _clickEnabled; }; #endif |