summaryrefslogtreecommitdiff
path: root/source/keyboard.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2007-02-16 01:10:41 +0000
committerIan C <ianc@noddybox.co.uk>2007-02-16 01:10:41 +0000
commitb369f37c6244b5d56742b56f745219fb2544efe2 (patch)
treea838093b033d302e6c7f64e7e255594d490d093a /source/keyboard.c
parent284d8dec91155107f04ad4e2c02338bcb6263abc (diff)
Some hi-res support. Added new config page and averaging touchscreen reads.
In process of writing file selector.
Diffstat (limited to 'source/keyboard.c')
-rw-r--r--source/keyboard.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/source/keyboard.c b/source/keyboard.c
index cb6a932..37ae4ef 100644
--- a/source/keyboard.c
+++ b/source/keyboard.c
@@ -24,6 +24,7 @@
#include "keyboard.h"
#include "framebuffer.h"
+#include "touchwrap.h"
#include "keyb_bin.h"
/* ---------------------------------------- STATIC DATA
@@ -166,36 +167,39 @@ static int GetEvent(SoftKeyEvent *ev, int map)
*/
if (keys & KEY_TOUCH)
{
- touchPosition tp=touchReadXY();
+ touchPosition tp;
- if (tp.py<21 || tp.py>165)
+ if (AllowTouch(&tp))
{
- key_state[SK_CONFIG].new_state = TRUE;
- }
- else
- {
- SoftKey press;
-
- press = LocatePress(&tp);
-
- if (press != NUM_SOFT_KEYS)
+ if (tp.py<21 || tp.py>165)
+ {
+ key_state[SK_CONFIG].new_state = TRUE;
+ }
+ else
{
- key_state[press].handled = TRUE;
+ SoftKey press;
+
+ press = LocatePress(&tp);
- if (key_state[press].is_sticky)
+ if (press != NUM_SOFT_KEYS)
{
- if (last != press)
+ key_state[press].handled = TRUE;
+
+ if (key_state[press].is_sticky)
{
- key_state[press].new_state =
- !key_state[press].state;
+ if (last != press)
+ {
+ key_state[press].new_state =
+ !key_state[press].state;
+ }
+ }
+ else
+ {
+ key_state[press].new_state = TRUE;
}
- }
- else
- {
- key_state[press].new_state = TRUE;
- }
- last = press;
+ last = press;
+ }
}
}
}