forked from len0rd/rockbox
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
This commit is contained in:
parent
99d2a4b436
commit
3c348df5ca
10 changed files with 11 additions and 11 deletions
|
|
@ -149,8 +149,7 @@ void init(void)
|
||||||
global_settings.mdb_enable,
|
global_settings.mdb_enable,
|
||||||
global_settings.superbass);
|
global_settings.superbass);
|
||||||
mpeg_init();
|
mpeg_init();
|
||||||
while (button_get(false) != 0)
|
button_clear_queue(); /* Empty the keyboard buffer */
|
||||||
; /* Empty the keyboard buffer */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -397,7 +397,7 @@ void cal_initial (void)
|
||||||
printResult();
|
printResult();
|
||||||
|
|
||||||
/* clear button queue */
|
/* 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 ) */
|
} /* while (calStatus != cal_exit ) */
|
||||||
|
|
||||||
/* rb->splash(HZ*2, true, "Hello world!"); */
|
/* rb->splash(HZ*2, true, "Hello world!"); */
|
||||||
while (rb->button_get(false));
|
rb->button_clear_queue();
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -437,7 +437,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
load_config();
|
load_config();
|
||||||
|
|
||||||
/*Empty the event queue*/
|
/*Empty the event queue*/
|
||||||
while (rb->button_get(false)!=BUTTON_NONE) ;
|
rb->button_clear_queue();
|
||||||
|
|
||||||
display(e,h,false);
|
display(e,h,false);
|
||||||
show_abbrev();
|
show_abbrev();
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb->lcd_puts_scroll(0,1,"PLAY to begin");
|
rb->lcd_puts_scroll(0,1,"PLAY to begin");
|
||||||
|
|
||||||
/*Empty the event queue*/
|
/*Empty the event queue*/
|
||||||
while (rb->button_get(false)!=BUTTON_NONE);
|
rb->button_clear_queue();
|
||||||
|
|
||||||
/* Define the start pattern */
|
/* Define the start pattern */
|
||||||
s[0]=(rb->rand()%9)*7;
|
s[0]=(rb->rand()%9)*7;
|
||||||
|
|
|
||||||
|
|
@ -1520,7 +1520,7 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
int lastbutton = 0;
|
int lastbutton = 0;
|
||||||
|
|
||||||
/*empty the button queue first, to avoid unwanted scrolling */
|
/*empty the button queue first, to avoid unwanted scrolling */
|
||||||
while(rb->button_get(false) != BUTTON_NONE);
|
rb->button_clear_queue();
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
min=0;
|
min=0;
|
||||||
|
|
||||||
/*Empty the event queue*/
|
/*Empty the event queue*/
|
||||||
while (rb->button_get(false)!=BUTTON_NONE);
|
rb->button_clear_queue();
|
||||||
|
|
||||||
/* Game loop */
|
/* Game loop */
|
||||||
while(end!=true)
|
while(end!=true)
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ static void fill_buffer(long pos, unsigned char* buf, unsigned size)
|
||||||
|
|
||||||
rb->lseek(fd, pos, SEEK_SET);
|
rb->lseek(fd, pos, SEEK_SET);
|
||||||
numread = rb->read(fd, buf, size);
|
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++) {
|
for(i = 0; i < numread; i++) {
|
||||||
switch(buf[i]) {
|
switch(buf[i]) {
|
||||||
|
|
|
||||||
|
|
@ -901,7 +901,7 @@ void splash(int ticks, /* how long the splash is displayed */
|
||||||
void charging_splash(void)
|
void charging_splash(void)
|
||||||
{
|
{
|
||||||
splash(2*HZ, true, str(LANG_BATTERY_CHARGE));
|
splash(2*HZ, true, str(LANG_BATTERY_CHARGE));
|
||||||
while (button_get(false));
|
button_clear_queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1127,7 +1127,7 @@ static bool dirbrowse(void)
|
||||||
lastfilter = *tc.dirfilter;
|
lastfilter = *tc.dirfilter;
|
||||||
lastsortcase = global_settings.sort_case;
|
lastsortcase = global_settings.sort_case;
|
||||||
restore = true;
|
restore = true;
|
||||||
while (button_get(false)); /* clear button queue */
|
button_clear_queue(); /* clear button queue */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exit_func)
|
if (exit_func)
|
||||||
|
|
|
||||||
|
|
@ -235,4 +235,5 @@ int button_status(void)
|
||||||
|
|
||||||
void button_clear_queue(void)
|
void button_clear_queue(void)
|
||||||
{
|
{
|
||||||
|
while (get_raw_button());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue