summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-07-23 21:38:43 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-07-23 21:38:43 +0000
commit15d04fdb00e7f94aef49cf9a70e73c5a46e21536 (patch)
tree148f46c4769f17db06b33ccc1c9e7ae7c8d3403c
parent0e067bbe557188431d436955b3b22607a52f800e (diff)
Somewhat better key combination handling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4930 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/x11/button-x11.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 43b33fa305..8187125dff 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -49,6 +49,8 @@ void button_init()
extern int screenhack_handle_events(bool *release, bool *repeat);
+int button_state = 0;
+
static int get_raw_button (void)
{
int k;
@@ -144,13 +146,22 @@ static int get_raw_button (void)
break;
}
- if(release)
+ if(release) {
/* return a release event */
+ button_state &= ~k;
k |= BUTTON_REL;
+ } else {
+ if(k) {
+ button_state |= k;
+ k = button_state;
+ }
+ }
if(repeat)
k |= BUTTON_REPEAT;
+ if(k)
+ DEBUGF("key: %08x\n", k);
return k;
}