summaryrefslogtreecommitdiff
path: root/uisimulator/x11
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-07 08:43:55 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-07 08:43:55 +0000
commita398aa49ddad0f53e305d87336f3015667fd0636 (patch)
treed3abd904bdc16cf59c1b63e043770f20e1ae8897 /uisimulator/x11
parenta93801da31e5346bcee816fe31560b77a6796ace (diff)
healing the X11 simulator (button_get_w_tmo wise), please bear with me as I
haven't tested this fix but it compiles nicely ;-) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1579 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11')
-rw-r--r--uisimulator/x11/button-x11.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 1d27eff134..734272c6c4 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -135,6 +135,25 @@ static int get_raw_button (void)
}
/*
+ * Timeout after TICKS unless a key is pressed.
+ */
+int button_get_w_tmo(int ticks)
+{
+ int bits;
+ int i=0;
+
+ for(i=0; i< ticks; i++) {
+ bits = get_raw_button();
+ if(!bits)
+ x11_sleep(1);
+ else
+ break;
+ };
+
+ return bits;
+}
+
+/*
* Get the currently pressed button.
* Returns one of BUTTON_xxx codes, with possibly a modifier bit set.
* No modifier bits are set when the button is first pressed.