summaryrefslogtreecommitdiff
path: root/uisimulator/x11/button-x11.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-04-23 18:49:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-04-23 18:49:57 +0000
commiteae511030cd7540e37a11d4c6d5147fd5c186a1a (patch)
treef5658e9f0bd569faa840cba8d877be00cc3cdaac /uisimulator/x11/button-x11.c
parent4ccffb658931503b3badb70a99d72a0cfb9834b1 (diff)
downloadrockbox-eae511030cd7540e37a11d4c6d5147fd5c186a1a.tar.gz
rockbox-eae511030cd7540e37a11d4c6d5147fd5c186a1a.zip
Now supports key-repeat in the simulator!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3594 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11/button-x11.c')
-rw-r--r--uisimulator/x11/button-x11.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 9f009f0e72..ae16e2e891 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -18,6 +18,7 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19#include "button.h" 19#include "button.h"
20#include "kernel.h" 20#include "kernel.h"
21#include "debug.h"
21 22
22#include "X11/keysym.h" 23#include "X11/keysym.h"
23 24
@@ -62,15 +63,15 @@ int button_set_release(int newmask)
62 * Q=On Return=Menu 63 * Q=On Return=Menu
63 */ 64 */
64 65
65/* from uibasic.c */ 66extern int screenhack_handle_events(bool *release, bool *repeat);
66extern int screenhack_handle_events(bool *release);
67 67
68static int get_raw_button (void) 68static int get_raw_button (void)
69{ 69{
70 int k; 70 int k;
71 bool release=false; /* is this a release event */ 71 bool release=false; /* is this a release event */
72 72 bool repeat=false; /* is the key a repeated one */
73 switch(screenhack_handle_events(&release)) 73 int ev=screenhack_handle_events(&release, &repeat);
74 switch(ev)
74 { 75 {
75 case XK_KP_Left: 76 case XK_KP_Left:
76 case XK_Left: 77 case XK_Left:
@@ -145,13 +146,18 @@ static int get_raw_button (void)
145 146
146 default: 147 default:
147 k = 0; 148 k = 0;
149 if(ev)
150 DEBUGF("received ev %d\n", ev);
148 break; 151 break;
149 } 152 }
150 153
151 if ( release ) 154 if(release)
152 /* return a release event */ 155 /* return a release event */
153 k |= BUTTON_REL; 156 k |= BUTTON_REL;
154 157
158 if(repeat)
159 k |= BUTTON_REPEAT;
160
155 return k; 161 return k;
156} 162}
157 163