WEBOS: Fixed ESCAPE and MENU key on WebOS 1

This commit is contained in:
Klaus Reimer 2011-05-08 20:45:50 +02:00
parent a6dc171255
commit cc0d8b6252

View File

@ -95,6 +95,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;
}
@ -115,6 +117,14 @@ bool WebOSSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) {
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);
}