diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-04-23 18:49:57 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-04-23 18:49:57 +0000 |
commit | eae511030cd7540e37a11d4c6d5147fd5c186a1a (patch) | |
tree | f5658e9f0bd569faa840cba8d877be00cc3cdaac /uisimulator/x11/button-x11.c | |
parent | 4ccffb658931503b3badb70a99d72a0cfb9834b1 (diff) | |
download | rockbox-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.c | 16 |
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 @@ ****************************************************************************/ #include "button.h" #include "kernel.h" +#include "debug.h" #include "X11/keysym.h" @@ -62,15 +63,15 @@ int button_set_release(int newmask) * Q=On Return=Menu */ -/* from uibasic.c */ -extern int screenhack_handle_events(bool *release); +extern int screenhack_handle_events(bool *release, bool *repeat); static int get_raw_button (void) { int k; bool release=false; /* is this a release event */ - - switch(screenhack_handle_events(&release)) + bool repeat=false; /* is the key a repeated one */ + int ev=screenhack_handle_events(&release, &repeat); + switch(ev) { case XK_KP_Left: case XK_Left: @@ -145,13 +146,18 @@ static int get_raw_button (void) default: k = 0; + if(ev) + DEBUGF("received ev %d\n", ev); break; } - if ( release ) + if(release) /* return a release event */ k |= BUTTON_REL; + if(repeat) + k |= BUTTON_REPEAT; + return k; } |