diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-23 21:38:43 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-23 21:38:43 +0000 |
commit | 15d04fdb00e7f94aef49cf9a70e73c5a46e21536 (patch) | |
tree | 148f46c4769f17db06b33ccc1c9e7ae7c8d3403c /uisimulator/x11/button-x11.c | |
parent | 0e067bbe557188431d436955b3b22607a52f800e (diff) | |
download | rockbox-15d04fdb00e7f94aef49cf9a70e73c5a46e21536.tar.gz rockbox-15d04fdb00e7f94aef49cf9a70e73c5a46e21536.zip |
Somewhat better key combination handling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4930 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11/button-x11.c')
-rw-r--r-- | uisimulator/x11/button-x11.c | 13 |
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() | |||
49 | 49 | ||
50 | extern int screenhack_handle_events(bool *release, bool *repeat); | 50 | extern int screenhack_handle_events(bool *release, bool *repeat); |
51 | 51 | ||
52 | int button_state = 0; | ||
53 | |||
52 | static int get_raw_button (void) | 54 | static int get_raw_button (void) |
53 | { | 55 | { |
54 | int k; | 56 | int k; |
@@ -144,13 +146,22 @@ static int get_raw_button (void) | |||
144 | break; | 146 | break; |
145 | } | 147 | } |
146 | 148 | ||
147 | if(release) | 149 | if(release) { |
148 | /* return a release event */ | 150 | /* return a release event */ |
151 | button_state &= ~k; | ||
149 | k |= BUTTON_REL; | 152 | k |= BUTTON_REL; |
153 | } else { | ||
154 | if(k) { | ||
155 | button_state |= k; | ||
156 | k = button_state; | ||
157 | } | ||
158 | } | ||
150 | 159 | ||
151 | if(repeat) | 160 | if(repeat) |
152 | k |= BUTTON_REPEAT; | 161 | k |= BUTTON_REPEAT; |
153 | 162 | ||
163 | if(k) | ||
164 | DEBUGF("key: %08x\n", k); | ||
154 | return k; | 165 | return k; |
155 | } | 166 | } |
156 | 167 | ||