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 /apps | |
| parent | 99d2a4b43642aef2ff859ed8195b62d3b2110a26 (diff) | |
| download | rockbox-3c348df5cafaf5d893c610fd2caf8234abe5cf88.zip rockbox-3c348df5cafaf5d893c610fd2caf8234abe5cf88.tar.gz rockbox-3c348df5cafaf5d893c610fd2caf8234abe5cf88.tar.bz2 rockbox-3c348df5cafaf5d893c610fd2caf8234abe5cf88.tar.xz | |
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
Diffstat (limited to 'apps')
| -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 |
9 files changed, 10 insertions, 11 deletions
diff --git a/apps/main.c b/apps/main.c index ef8ca7b..8bcc25a 100644 --- a/apps/main.c +++ b/apps/main.c @@ -149,8 +149,7 @@ void init(void) global_settings.mdb_enable, global_settings.superbass); mpeg_init(); - while (button_get(false) != 0) - ; /* Empty the keyboard buffer */ + button_clear_queue(); /* Empty the keyboard buffer */ } #else diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index 04231f4..193ac8a 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -397,7 +397,7 @@ void cal_initial (void) printResult(); /* clear button queue */ - while (rb->button_get(false)); + rb->button_clear_queue(); } /* ----------------------------------------------------------------------- @@ -1357,7 +1357,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) } /* while (calStatus != cal_exit ) */ /* rb->splash(HZ*2, true, "Hello world!"); */ - while (rb->button_get(false)); + rb->button_clear_queue(); return PLUGIN_OK; } diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c index 0a01f3a..3fb1e0e 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) load_config(); /*Empty the event queue*/ - while (rb->button_get(false)!=BUTTON_NONE) ; + rb->button_clear_queue(); display(e,h,false); show_abbrev(); diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c index e392c3b..d35e35a 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) rb->lcd_puts_scroll(0,1,"PLAY to begin"); /*Empty the event queue*/ - while (rb->button_get(false)!=BUTTON_NONE); + rb->button_clear_queue(); /* Define the start pattern */ s[0]=(rb->rand()%9)*7; diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index c601712..d760812 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c @@ -1520,7 +1520,7 @@ int scroll_bmp(struct t_disp* pdisp) int lastbutton = 0; /*empty the button queue first, to avoid unwanted scrolling */ - while(rb->button_get(false) != BUTTON_NONE); + rb->button_clear_queue(); while (true) { diff --git a/apps/plugins/nim.c b/apps/plugins/nim.c index 48e0937..27f1210 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) min=0; /*Empty the event queue*/ - while (rb->button_get(false)!=BUTTON_NONE); + rb->button_clear_queue(); /* Game loop */ while(end!=true) diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 4628f8e..281868b 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) rb->lseek(fd, pos, SEEK_SET); numread = rb->read(fd, buf, size); - while (rb->button_get(false)); /* clear button queue */ + rb->button_clear_queue(); /* clear button queue */ for(i = 0; i < numread; i++) { switch(buf[i]) { diff --git a/apps/screens.c b/apps/screens.c index e4f44dd..8010ebf 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -901,7 +901,7 @@ void splash(int ticks, /* how long the splash is displayed */ void charging_splash(void) { splash(2*HZ, true, str(LANG_BATTERY_CHARGE)); - while (button_get(false)); + button_clear_queue(); } diff --git a/apps/tree.c b/apps/tree.c index 7c21dfe..b482682 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1127,7 +1127,7 @@ static bool dirbrowse(void) lastfilter = *tc.dirfilter; lastsortcase = global_settings.sort_case; restore = true; - while (button_get(false)); /* clear button queue */ + button_clear_queue(); /* clear button queue */ } if (exit_func) |