X-Git-Url: https://code.delx.au/refind/blobdiff_plain/32fb076b277cc9e421d4a0c1cbcaab9cfee8c060..40ae0d1307c090f26cbf102d64547d558d62e9f2:/gptsync/os_efi.c diff --git a/gptsync/os_efi.c b/gptsync/os_efi.c index 51293d8..e857f71 100644 --- a/gptsync/os_efi.c +++ b/gptsync/os_efi.c @@ -125,15 +125,13 @@ UINTN input_boolean(CHARN *prompt, BOOLEAN *bool_out) Print(prompt); - if (ReadAllKeyStrokes()) { // remove buffered key strokes - refit_call1_wrapper(BS->Stall, 500000); // 0.5 seconds delay - ReadAllKeyStrokes(); // empty the buffer again - } - - refit_call3_wrapper(BS->WaitForEvent, 1, &ST->ConIn->WaitForKey, &Index); - Status = refit_call2_wrapper(ST->ConIn->ReadKeyStroke, ST->ConIn, &Key); - if (EFI_ERROR(Status)) - return 1; + ReadAllKeyStrokes(); // Remove buffered key strokes + do { + refit_call3_wrapper(BS->WaitForEvent, 1, &ST->ConIn->WaitForKey, &Index); + Status = refit_call2_wrapper(ST->ConIn->ReadKeyStroke, ST->ConIn, &Key); + if (EFI_ERROR(Status) && Status != EFI_NOT_READY) + return 1; + } while (Status == EFI_NOT_READY); if (Key.UnicodeChar == 'y' || Key.UnicodeChar == 'Y') { Print(L"Yes\n");