Skip to content

Commit

Permalink
touchpad virtual keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
doronrosenberg committed Aug 4, 2011
1 parent 1d03414 commit 3c15930
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
28 changes: 24 additions & 4 deletions backends/events/webossdl/webossdl-events.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion configure
Expand Up @@ -2395,7 +2395,7 @@ case $_backend in
;;
webos)
# There is no sdl-config in the WebOS PDK so we don't use find_sdlconfig here.
LIBS="$LIBS -lSDL"
LIBS="$LIBS -lSDL -lpdl"
DEFINES="$DEFINES -DWEBOS"
DEFINES="$DEFINES -DSDL_BACKEND"
add_line_to_config_mk "SDL_BACKEND = 1"
Expand Down

0 comments on commit 3c15930

Please sign in to comment.