From 15d04fdb00e7f94aef49cf9a70e73c5a46e21536 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Fri, 23 Jul 2004 21:38:43 +0000 Subject: Somewhat better key combination handling git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4930 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/x11/button-x11.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3