summaryrefslogtreecommitdiffstats
path: root/uisimulator/x11/button-x11.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-10-14 08:09:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-10-14 08:09:29 +0000
commit5fcce4da583b2524c93febefb0e2962a889c9ae1 (patch)
tree7dfd35da4ac481bc71f4dd8c3c20c6f716504942 /uisimulator/x11/button-x11.c
parentea60436cd8b26dc375993eede6b98653f00e2548 (diff)
downloadrockbox-5fcce4da583b2524c93febefb0e2962a889c9ae1.tar.gz
rockbox-5fcce4da583b2524c93febefb0e2962a889c9ae1.tar.bz2
rockbox-5fcce4da583b2524c93febefb0e2962a889c9ae1.zip
Now the X11 simulator sets the BUTTON_REL bit properly and thus generates
button release events, much in the same way the actual target behaves. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2606 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11/button-x11.c')
-rw-r--r--uisimulator/x11/button-x11.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index d1310d71e2..c838677778 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -63,19 +63,14 @@ int button_set_release(int newmask)
*/
/* from uibasic.c */
-extern int screenhack_handle_events (void);
+extern int screenhack_handle_events(bool *release);
static int get_raw_button (void)
{
int k;
- static int next = 0;
- if ( next ) {
- k = next;
- next = 0;
- return k;
- }
+ bool release=false; /* is this a release event */
- switch(screenhack_handle_events())
+ switch(screenhack_handle_events(&release))
{
case XK_KP_Left:
case XK_Left:
@@ -153,8 +148,9 @@ static int get_raw_button (void)
break;
}
- if ( k )
- next = k | BUTTON_REL;
+ if ( release )
+ /* return a release event */
+ k |= BUTTON_REL;
return k;
}