...\r
)\r
{\r
+ EFI_STATUS Status;\r
VA_LIST Args;\r
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;\r
EFI_SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;\r
// Wait for a keystroke\r
//\r
if (Key != NULL) {\r
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
- gST->ConIn->ReadKeyStroke (gST->ConIn, Key);\r
+ while (TRUE) {\r
+ Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key);\r
+ if (!EFI_ERROR (Status)) {\r
+ break;\r
+ }\r
+\r
+ //\r
+ // If we encounter error, continue to read another key in.\r
+ //\r
+ if (Status != EFI_NOT_READY) {\r
+ continue;\r
+ }\r
+ gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
+ }\r
}\r
}\r