Add support for actions triggered by key combination

Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
This commit is contained in:
Vojtech Bocek
2014-03-13 17:36:52 +01:00
committed by Gerrit Code Review
parent 9c102b536d
commit 0b7fe504dc
9 changed files with 145 additions and 48 deletions
+14 -17
View File
@@ -187,8 +187,8 @@ static void * input_thread(void *cookie)
static int x = 0, y = 0;
static int lshift = 0, rshift = 0;
static struct timeval touchStart;
HardwareKeyboard kb;
string seconds;
HardwareKeyboard *kb = PageManager::GetHardwareKeyboard();
MouseCursor *cursor = PageManager::GetMouseCursor();
#ifndef TW_NO_SCREEN_TIMEOUT
@@ -249,7 +249,7 @@ static void * input_thread(void *cookie)
#endif
gettimeofday(&touchStart, NULL);
key_repeat = 2;
kb.KeyRepeat();
kb->KeyRepeat();
#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
#endif
@@ -261,7 +261,7 @@ static void * input_thread(void *cookie)
LOGERR("KEY_REPEAT: %d,%d\n", x, y);
#endif
gettimeofday(&touchStart, NULL);
kb.KeyRepeat();
kb->KeyRepeat();
#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
#endif
@@ -356,6 +356,9 @@ static void * input_thread(void *cookie)
{
cursor->GetPos(x, y);
#ifdef _EVENT_LOGGING
LOGERR("TOUCH_RELEASE: %d,%d\n", x, y);
#endif
PageManager::NotifyTouch(TOUCH_RELEASE, x, y);
touch_and_hold = 0;
@@ -371,15 +374,13 @@ static void * input_thread(void *cookie)
else if(ev.code == BTN_SIDE)
{
if(ev.value == 1)
kb.KeyDown(KEY_BACK);
kb->KeyDown(KEY_BACK);
else
kb.KeyUp(KEY_BACK);
}
else if (ev.value != 0)
{
kb->KeyUp(KEY_BACK);
} else if (ev.value != 0) {
// This is a key press
if (kb.KeyDown(ev.code))
{
if (kb->KeyDown(ev.code)) {
// Key repeat is enabled for this key
key_repeat = 1;
touch_and_hold = 0;
touch_repeat = 0;
@@ -388,9 +389,7 @@ static void * input_thread(void *cookie)
#ifndef TW_NO_SCREEN_TIMEOUT
blankTimer.resetTimerAndUnblank();
#endif
}
else
{
} else {
key_repeat = 0;
touch_and_hold = 0;
touch_repeat = 0;
@@ -399,11 +398,9 @@ static void * input_thread(void *cookie)
blankTimer.resetTimerAndUnblank();
#endif
}
}
else
{
} else {
// This is a key release
kb.KeyUp(ev.code);
kb->KeyUp(ev.code);
key_repeat = 0;
touch_and_hold = 0;
touch_repeat = 0;