From b369f37c6244b5d56742b56f745219fb2544efe2 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 16 Feb 2007 01:10:41 +0000 Subject: Some hi-res support. Added new config page and averaging touchscreen reads. In process of writing file selector. --- source/keyboard.c | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'source/keyboard.c') 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; + } } } } -- cgit v1.2.3