summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 8670d90..e41b720 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;
}
/* -----------------------------------------------------------------