aboutsummaryrefslogtreecommitdiff
path: root/backends/events/webossdl/webossdl-events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/events/webossdl/webossdl-events.cpp')
-rw-r--r--backends/events/webossdl/webossdl-events.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp
index 24aa5f0abd..4a17bc2066 100644
--- a/backends/events/webossdl/webossdl-events.cpp
+++ b/backends/events/webossdl/webossdl-events.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifdef WEBOS
@@ -39,9 +36,6 @@
// Inidicates if gesture area is pressed down or not.
static bool gestureDown = false;
-// The timestamp when gesture area was pressed down.
-static int gestureDownTime = 0;
-
// The timestamp when screen was pressed down.
static int screenDownTime = 0;
@@ -95,6 +89,8 @@ void WebOSSdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod,
event.kbd.flags |= Common::KBD_SHIFT;
if (mod & KMOD_CTRL)
event.kbd.flags |= Common::KBD_CTRL;
+
+ // Holding down the gesture area emulates the ALT key
if (gestureDown)
event.kbd.flags |= Common::KBD_ALT;
}
@@ -111,10 +107,17 @@ bool WebOSSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) {
// Handle gesture area tap.
if (ev.key.keysym.sym == SDLK_WORLD_71) {
gestureDown = true;
- gestureDownTime = getMillis();
return true;
}
+ // Ensure that ALT key (Gesture down) is ignored when back or forward
+ // gesture is detected. This is needed for WebOS 1 which releases the
+ // gesture tap AFTER the backward gesture event and not BEFORE (Like
+ // WebOS 2).
+ if (ev.key.keysym.sym == 27 || ev.key.keysym.sym == 229) {
+ gestureDown = false;
+ }
+
// Call original SDL key handler.
return SdlEventSource::handleKeyDown(ev, event);
}