diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-05-28 15:05:16 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-05-28 15:05:16 +0000 |
commit | 132a09b0574583a9fb0d63ebe77a5cd693038816 (patch) | |
tree | 1403cf461689a03a5dd4e04f76538a66dcd625d9 /uisimulator/x11/button-x11.c | |
parent | 3bd3cfcfe067096db897d1eae6443d05e908fb1a (diff) | |
download | rockbox-132a09b0574583a9fb0d63ebe77a5cd693038816.tar.gz 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.c | 14 |
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 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "button.h" | 19 | #include "button.h" |
20 | #include "kernel.h" | ||
20 | 21 | ||
21 | #include "X11/keysym.h" | 22 | #include "X11/keysym.h" |
22 | 23 | ||
@@ -102,9 +103,18 @@ static int get_raw_button (void) | |||
102 | * BUTTON_HELD bit is while the button is being held. | 103 | * BUTTON_HELD bit is while the button is being held. |
103 | * BUTTON_REL bit is set when button has been released. | 104 | * BUTTON_REL bit is set when button has been released. |
104 | */ | 105 | */ |
105 | int button_get(void) | 106 | int button_get(bool block) |
106 | { | 107 | { |
107 | return get_raw_button(); | 108 | int bits; |
109 | do { | ||
110 | bits = get_raw_button(); | ||
111 | if(block && !bits) | ||
112 | x11_sleep(HZ/4); | ||
113 | else | ||
114 | break; | ||
115 | } while(1); | ||
116 | |||
117 | return bits; | ||
108 | } | 118 | } |
109 | 119 | ||
110 | /* ----------------------------------------------------------------- | 120 | /* ----------------------------------------------------------------- |