From 3126b06600016893f85e492b645a0773847aeb39 Mon Sep 17 00:00:00 2001 From: Doron Rosenberg Date: Mon, 1 Aug 2011 12:01:22 -0700 Subject: WebOS: touchpad work to show menu --- backends/events/webossdl/webossdl-events.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'backends/events') diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index 102eb5802e..acc54e0bd2 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -32,6 +32,7 @@ #include "backends/events/webossdl/webossdl-events.h" #include "gui/message.h" +#include "engines/engine.h" // Inidicates if gesture area is pressed down or not. static bool gestureDown = false; @@ -176,6 +177,15 @@ bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even if (motionPtrIndex == ev.button.which) { motionPtrIndex = -1; + int screenY = g_system->getHeight(); + // 60% of the screen height for menu dialog + if (ABS(dragDiffY) >= ABS(screenY*0.6)) { + if (g_engine && !g_engine->isPaused()) { + g_engine->openMainMenuDialog(); + return true; + } + } + // When drag mode was active then simply send a mouse up event if (dragging) { -- cgit v1.2.3 From 0ceb7b4ccd89150e46f92545bf4bdbb070cede12 Mon Sep 17 00:00:00 2001 From: Doron Rosenberg Date: Thu, 4 Aug 2011 10:44:06 -0700 Subject: WebOS: touchpad virtual keyboard --- backends/events/webossdl/webossdl-events.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'backends/events') diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index acc54e0bd2..00cbf39d08 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -33,6 +33,7 @@ #include "backends/events/webossdl/webossdl-events.h" #include "gui/message.h" #include "engines/engine.h" +#include "PDL.h" // Inidicates if gesture area is pressed down or not. static bool gestureDown = false; @@ -138,6 +139,16 @@ bool WebOSSdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) { return true; } + // handle virtual keyboard dismiss key + if (ev.key.keysym.sym == 24) { + int gblPDKVersion = PDL_GetPDKVersion(); + // check for correct PDK Version + if (gblPDKVersion >= 300) { + PDL_SetKeyboardState(PDL_FALSE); + return true; + } + } + // Call original SDL key handler. return SdlEventSource::handleKeyUp(ev, event); } @@ -178,11 +189,20 @@ bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even motionPtrIndex = -1; int screenY = g_system->getHeight(); - // 60% of the screen height for menu dialog + + // 60% of the screen height for menu dialog/keyboard if (ABS(dragDiffY) >= ABS(screenY*0.6)) { - if (g_engine && !g_engine->isPaused()) { - g_engine->openMainMenuDialog(); - return true; + if (dragDiffY >= 0) { + int gblPDKVersion = PDL_GetPDKVersion(); + // check for correct PDK Version + if (gblPDKVersion >= 300) { + PDL_SetKeyboardState(PDL_TRUE); + } + } else { + if (g_engine && !g_engine->isPaused()) { + g_engine->openMainMenuDialog(); + return true; + } } } -- cgit v1.2.3 From 82a3cc0ac06e598e069ad207ab741cd7397df329 Mon Sep 17 00:00:00 2001 From: Doron Rosenberg Date: Thu, 4 Aug 2011 10:50:19 -0700 Subject: WebOS: fix indentation, make sure to return true when opening the keyboard --- backends/events/webossdl/webossdl-events.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'backends/events') diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index 00cbf39d08..cec990e775 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -141,10 +141,10 @@ bool WebOSSdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) { // handle virtual keyboard dismiss key if (ev.key.keysym.sym == 24) { - int gblPDKVersion = PDL_GetPDKVersion(); - // check for correct PDK Version - if (gblPDKVersion >= 300) { - PDL_SetKeyboardState(PDL_FALSE); + int gblPDKVersion = PDL_GetPDKVersion(); + // check for correct PDK Version + if (gblPDKVersion >= 300) { + PDL_SetKeyboardState(PDL_FALSE); return true; } } @@ -191,20 +191,21 @@ bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even int screenY = g_system->getHeight(); // 60% of the screen height for menu dialog/keyboard - if (ABS(dragDiffY) >= ABS(screenY*0.6)) { + if (ABS(dragDiffY) >= ABS(screenY*0.6)) { if (dragDiffY >= 0) { int gblPDKVersion = PDL_GetPDKVersion(); // check for correct PDK Version if (gblPDKVersion >= 300) { PDL_SetKeyboardState(PDL_TRUE); + return true; } } else { - if (g_engine && !g_engine->isPaused()) { - g_engine->openMainMenuDialog(); - return true; + if (g_engine && !g_engine->isPaused()) { + g_engine->openMainMenuDialog(); + return true; } - } - } + } + } // When drag mode was active then simply send a mouse up event if (dragging) -- cgit v1.2.3 From 28201a1e9d1825ea2b590288f06003a8ae7a7e00 Mon Sep 17 00:00:00 2001 From: Doron Rosenberg Date: Wed, 10 Aug 2011 17:44:48 -0700 Subject: WebOS: not handling keyboard dismiss in keydown breaks things --- backends/events/webossdl/webossdl-events.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'backends/events') diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index cec990e775..01b2c1ea7f 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -120,6 +120,16 @@ bool WebOSSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { gestureDown = false; } + // handle virtual keyboard dismiss key + if (ev.key.keysym.sym == 24) { + int gblPDKVersion = PDL_GetPDKVersion(); + // check for correct PDK Version + if (gblPDKVersion >= 300) { + PDL_SetKeyboardState(PDL_FALSE); + return true; + } + } + // Call original SDL key handler. return SdlEventSource::handleKeyDown(ev, event); } -- cgit v1.2.3