summaryrefslogtreecommitdiffstats
path: root/uisimulator/x11/button-x11.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-28 15:05:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-28 15:05:16 +0000
commit132a09b0574583a9fb0d63ebe77a5cd693038816 (patch)
tree1403cf461689a03a5dd4e04f76538a66dcd625d9 /uisimulator/x11/button-x11.c
parent3bd3cfcfe067096db897d1eae6443d05e908fb1a (diff)
downloadrockbox-132a09b0574583a9fb0d63ebe77a5cd693038816.tar.gz
rockbox-132a09b0574583a9fb0d63ebe77a5cd693038816.tar.bz2
rockbox-132a09b0574583a9fb0d63ebe77a5cd693038816.zip
adjusted to new button_get api
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@765 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11/button-x11.c')
-rw-r--r--uisimulator/x11/button-x11.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 8670d90b4f..e41b720d6f 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -17,6 +17,7 @@
*
****************************************************************************/
#include "button.h"
+#include "kernel.h"
#include "X11/keysym.h"
@@ -102,9 +103,18 @@ static int get_raw_button (void)
* BUTTON_HELD bit is while the button is being held.
* BUTTON_REL bit is set when button has been released.
*/
-int button_get(void)
+int button_get(bool block)
{
- return get_raw_button();
+ int bits;
+ do {
+ bits = get_raw_button();
+ if(block && !bits)
+ x11_sleep(HZ/4);
+ else
+ break;
+ } while(1);
+
+ return bits;
}
/* -----------------------------------------------------------------