aboutsummaryrefslogtreecommitdiff
path: root/backends/events
diff options
context:
space:
mode:
Diffstat (limited to 'backends/events')
-rw-r--r--backends/events/default/default-events.h4
-rw-r--r--backends/events/sdl/sdl-events.cpp3
-rw-r--r--backends/events/webossdl/webossdl-events.cpp18
3 files changed, 18 insertions, 7 deletions
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h
index 06db1dc027..73dc60695b 100644
--- a/backends/events/default/default-events.h
+++ b/backends/events/default/default-events.h
@@ -31,10 +31,10 @@
namespace Common {
#ifdef ENABLE_KEYMAPPER
- class Keymapper;
+class Keymapper;
#endif
#ifdef ENABLE_VKEYBD
- class VirtualKeyboard;
+class VirtualKeyboard;
#endif
}
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index ce846a0836..6e343b63f5 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -31,6 +31,7 @@
#include "backends/platform/sdl/sdl.h"
#include "backends/graphics/graphics.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
// FIXME move joystick defines out and replace with confile file options
// we should really allow users to map any key to a joystick button
@@ -65,7 +66,7 @@ SdlEventSource::SdlEventSource()
// Enable joystick
if (SDL_NumJoysticks() > 0) {
- printf("Using joystick: %s\n", SDL_JoystickName(0));
+ debug("Using joystick: %s", SDL_JoystickName(0));
_joystick = SDL_JoystickOpen(joystick_num);
}
}
diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp
index fd9628995d..3f3efe9e2a 100644
--- a/backends/events/webossdl/webossdl-events.cpp
+++ b/backends/events/webossdl/webossdl-events.cpp
@@ -25,7 +25,11 @@
#ifdef WEBOS
+// Allow use of stuff in <time.h>
+#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
+
#include "common/scummsys.h"
+#include "common/system.h"
#include "sys/time.h"
#include "time.h"
@@ -35,9 +39,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;
@@ -91,6 +92,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;
}
@@ -107,10 +110,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);
}