aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorTarek Soliman2012-02-09 01:26:46 -0600
committerTarek Soliman2012-02-12 13:28:13 -0600
commitd90d4d10a09e1bab04154aa81162aac9c994f23c (patch)
tree32bfaf0d6c66e3899595e599380b4ddbb86a7550 /backends
parent883f9ae07338cd044604c7821a22485d9e1f5683 (diff)
downloadscummvm-rg350-d90d4d10a09e1bab04154aa81162aac9c994f23c.tar.gz
scummvm-rg350-d90d4d10a09e1bab04154aa81162aac9c994f23c.tar.bz2
scummvm-rg350-d90d4d10a09e1bab04154aa81162aac9c994f23c.zip
MAEMO: Refactor toggle click mode
Diffstat (limited to 'backends')
-rw-r--r--backends/events/maemosdl/maemosdl-events.cpp12
-rw-r--r--backends/events/maemosdl/maemosdl-events.h2
2 files changed, 11 insertions, 3 deletions
diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp
index 07af368064..d7bda8c8d5 100644
--- a/backends/events/maemosdl/maemosdl-events.cpp
+++ b/backends/events/maemosdl/maemosdl-events.cpp
@@ -124,9 +124,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
debug(9, "remapping to F7 up (virtual keyboard)");
return true;
} else {
- _clickEnabled = !_clickEnabled;
- ((SurfaceSdlGraphicsManager*) _graphicsManager)->displayMessageOnOSD(
- _clickEnabled ? _("Clicking Enabled") : _("Clicking Disabled"));
+ toggleClickMode();
debug(9, "remapping to click toggle");
return true;
}
@@ -158,6 +156,14 @@ bool MaemoSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even
return SdlEventSource::handleMouseButtonUp(ev, event);
}
+bool MaemoSdlEventSource::toggleClickMode() {
+ _clickEnabled = !_clickEnabled;
+ ((SurfaceSdlGraphicsManager*) _graphicsManager)->displayMessageOnOSD(
+ _clickEnabled ? _("Clicking Enabled") : _("Clicking Disabled"));
+
+ return _clickEnabled;
+}
+
} // namespace Maemo
#endif // if defined(MAEMO)
diff --git a/backends/events/maemosdl/maemosdl-events.h b/backends/events/maemosdl/maemosdl-events.h
index 5c06c4bc22..f7b2bbf70b 100644
--- a/backends/events/maemosdl/maemosdl-events.h
+++ b/backends/events/maemosdl/maemosdl-events.h
@@ -37,6 +37,8 @@ namespace Maemo {
class MaemoSdlEventSource : public SdlEventSource {
public:
MaemoSdlEventSource();
+
+ bool toggleClickMode();
protected:
virtual bool remapKey(SDL_Event &ev, Common::Event &event);
virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);