Replace grub_checkkey with grub_getkey_noblock.
* grub-core/kern/term.c (grub_checkkey): Replaced with ... (grub_getkey_noblock): ... this. All users updated.
This commit is contained in:
parent
b500bcfeed
commit
a8f16eab1a
7 changed files with 28 additions and 36 deletions
|
@ -151,7 +151,7 @@ play (unsigned tempo, struct note *note)
|
|||
{
|
||||
unsigned int to;
|
||||
|
||||
if (note->pitch == T_FINE || grub_checkkey () >= 0)
|
||||
if (note->pitch == T_FINE || grub_getkey_noblock () != GRUB_TERM_NO_KEY)
|
||||
return 1;
|
||||
|
||||
grub_dprintf ("play", "pitch = %d, duration = %d\n", note->pitch,
|
||||
|
@ -169,7 +169,8 @@ play (unsigned tempo, struct note *note)
|
|||
}
|
||||
|
||||
to = grub_get_rtc () + BASE_TEMPO * note->duration / tempo;
|
||||
while (((unsigned int) grub_get_rtc () <= to) && (grub_checkkey () < 0))
|
||||
while (((unsigned int) grub_get_rtc () <= to)
|
||||
&& (grub_getkey_noblock () == GRUB_TERM_NO_KEY))
|
||||
;
|
||||
|
||||
return 0;
|
||||
|
@ -261,9 +262,6 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
beep_off ();
|
||||
|
||||
while (grub_checkkey () > 0)
|
||||
grub_getkey ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue