diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-01-26 22:48:25 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-01-26 22:48:25 +0000 |
commit | 3c348df5cafaf5d893c610fd2caf8234abe5cf88 (patch) | |
tree | 631a926bffd197b48c9e4edb8b568319808e74b7 | |
parent | 99d2a4b43642aef2ff859ed8195b62d3b2110a26 (diff) | |
download | rockbox-3c348df5cafaf5d893c610fd2caf8234abe5cf88.tar.gz rockbox-3c348df5cafaf5d893c610fd2caf8234abe5cf88.zip |
Changed several places to use button_clear_queue() to empty the button queue. Added the ability to empty the (system's) button queue to the X11 simulatr.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5665 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/main.c | 3 | ||||
-rw-r--r-- | apps/plugins/calculator.c | 4 | ||||
-rw-r--r-- | apps/plugins/euroconverter.c | 2 | ||||
-rw-r--r-- | apps/plugins/jackpot.c | 2 | ||||
-rw-r--r-- | apps/plugins/jpeg.c | 2 | ||||
-rw-r--r-- | apps/plugins/nim.c | 2 | ||||
-rw-r--r-- | apps/plugins/viewer.c | 2 | ||||
-rw-r--r-- | apps/screens.c | 2 | ||||
-rw-r--r-- | apps/tree.c | 2 | ||||
-rw-r--r-- | uisimulator/x11/button-x11.c | 1 |
10 files changed, 11 insertions, 11 deletions
diff --git a/apps/main.c b/apps/main.c index ef8ca7bea7..8bcc25ae40 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -149,8 +149,7 @@ void init(void) | |||
149 | global_settings.mdb_enable, | 149 | global_settings.mdb_enable, |
150 | global_settings.superbass); | 150 | global_settings.superbass); |
151 | mpeg_init(); | 151 | mpeg_init(); |
152 | while (button_get(false) != 0) | 152 | button_clear_queue(); /* Empty the keyboard buffer */ |
153 | ; /* Empty the keyboard buffer */ | ||
154 | } | 153 | } |
155 | 154 | ||
156 | #else | 155 | #else |
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index 04231f471e..193ac8a7ce 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c | |||
@@ -397,7 +397,7 @@ void cal_initial (void) | |||
397 | printResult(); | 397 | printResult(); |
398 | 398 | ||
399 | /* clear button queue */ | 399 | /* clear button queue */ |
400 | while (rb->button_get(false)); | 400 | rb->button_clear_queue(); |
401 | } | 401 | } |
402 | 402 | ||
403 | /* ----------------------------------------------------------------------- | 403 | /* ----------------------------------------------------------------------- |
@@ -1357,7 +1357,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
1357 | } /* while (calStatus != cal_exit ) */ | 1357 | } /* while (calStatus != cal_exit ) */ |
1358 | 1358 | ||
1359 | /* rb->splash(HZ*2, true, "Hello world!"); */ | 1359 | /* rb->splash(HZ*2, true, "Hello world!"); */ |
1360 | while (rb->button_get(false)); | 1360 | rb->button_clear_queue(); |
1361 | return PLUGIN_OK; | 1361 | return PLUGIN_OK; |
1362 | } | 1362 | } |
1363 | 1363 | ||
diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c index 0a01f3a1d6..3fb1e0e819 100644 --- a/apps/plugins/euroconverter.c +++ b/apps/plugins/euroconverter.c | |||
@@ -437,7 +437,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
437 | load_config(); | 437 | load_config(); |
438 | 438 | ||
439 | /*Empty the event queue*/ | 439 | /*Empty the event queue*/ |
440 | while (rb->button_get(false)!=BUTTON_NONE) ; | 440 | rb->button_clear_queue(); |
441 | 441 | ||
442 | display(e,h,false); | 442 | display(e,h,false); |
443 | show_abbrev(); | 443 | show_abbrev(); |
diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c index e392c3b35a..d35e35a8c0 100644 --- a/apps/plugins/jackpot.c +++ b/apps/plugins/jackpot.c | |||
@@ -125,7 +125,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
125 | rb->lcd_puts_scroll(0,1,"PLAY to begin"); | 125 | rb->lcd_puts_scroll(0,1,"PLAY to begin"); |
126 | 126 | ||
127 | /*Empty the event queue*/ | 127 | /*Empty the event queue*/ |
128 | while (rb->button_get(false)!=BUTTON_NONE); | 128 | rb->button_clear_queue(); |
129 | 129 | ||
130 | /* Define the start pattern */ | 130 | /* Define the start pattern */ |
131 | s[0]=(rb->rand()%9)*7; | 131 | s[0]=(rb->rand()%9)*7; |
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index c601712b11..d760812b86 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c | |||
@@ -1520,7 +1520,7 @@ int scroll_bmp(struct t_disp* pdisp) | |||
1520 | int lastbutton = 0; | 1520 | int lastbutton = 0; |
1521 | 1521 | ||
1522 | /*empty the button queue first, to avoid unwanted scrolling */ | 1522 | /*empty the button queue first, to avoid unwanted scrolling */ |
1523 | while(rb->button_get(false) != BUTTON_NONE); | 1523 | rb->button_clear_queue(); |
1524 | 1524 | ||
1525 | while (true) | 1525 | while (true) |
1526 | { | 1526 | { |
diff --git a/apps/plugins/nim.c b/apps/plugins/nim.c index 48e0937908..27f1210ea4 100644 --- a/apps/plugins/nim.c +++ b/apps/plugins/nim.c | |||
@@ -174,7 +174,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
174 | min=0; | 174 | min=0; |
175 | 175 | ||
176 | /*Empty the event queue*/ | 176 | /*Empty the event queue*/ |
177 | while (rb->button_get(false)!=BUTTON_NONE); | 177 | rb->button_clear_queue(); |
178 | 178 | ||
179 | /* Game loop */ | 179 | /* Game loop */ |
180 | while(end!=true) | 180 | while(end!=true) |
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 4628f8e7b3..281868bf65 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c | |||
@@ -356,7 +356,7 @@ static void fill_buffer(long pos, unsigned char* buf, unsigned size) | |||
356 | 356 | ||
357 | rb->lseek(fd, pos, SEEK_SET); | 357 | rb->lseek(fd, pos, SEEK_SET); |
358 | numread = rb->read(fd, buf, size); | 358 | numread = rb->read(fd, buf, size); |
359 | while (rb->button_get(false)); /* clear button queue */ | 359 | rb->button_clear_queue(); /* clear button queue */ |
360 | 360 | ||
361 | for(i = 0; i < numread; i++) { | 361 | for(i = 0; i < numread; i++) { |
362 | switch(buf[i]) { | 362 | switch(buf[i]) { |
diff --git a/apps/screens.c b/apps/screens.c index e4f44dd601..8010ebf022 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -901,7 +901,7 @@ void splash(int ticks, /* how long the splash is displayed */ | |||
901 | void charging_splash(void) | 901 | void charging_splash(void) |
902 | { | 902 | { |
903 | splash(2*HZ, true, str(LANG_BATTERY_CHARGE)); | 903 | splash(2*HZ, true, str(LANG_BATTERY_CHARGE)); |
904 | while (button_get(false)); | 904 | button_clear_queue(); |
905 | } | 905 | } |
906 | 906 | ||
907 | 907 | ||
diff --git a/apps/tree.c b/apps/tree.c index 7c21dfecdf..b482682e67 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1127,7 +1127,7 @@ static bool dirbrowse(void) | |||
1127 | lastfilter = *tc.dirfilter; | 1127 | lastfilter = *tc.dirfilter; |
1128 | lastsortcase = global_settings.sort_case; | 1128 | lastsortcase = global_settings.sort_case; |
1129 | restore = true; | 1129 | restore = true; |
1130 | while (button_get(false)); /* clear button queue */ | 1130 | button_clear_queue(); /* clear button queue */ |
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | if (exit_func) | 1133 | if (exit_func) |
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c index a8dd709110..ba70c8129b 100644 --- a/uisimulator/x11/button-x11.c +++ b/uisimulator/x11/button-x11.c | |||
@@ -235,4 +235,5 @@ int button_status(void) | |||
235 | 235 | ||
236 | void button_clear_queue(void) | 236 | void button_clear_queue(void) |
237 | { | 237 | { |
238 | while (get_raw_button()); | ||
238 | } | 239 | } |