summaryrefslogtreecommitdiffstats
path: root/gui/gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gui/gui.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 0164ec393..c0bd008a9 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -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;