From 4bab48ce880964b3ee709b5acd565160dbf9ff19 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Wed, 26 Dec 2012 11:44:46 +0800 Subject: Make sure the menu shows when the callback fails Since Pause() doesn't clear the key from the input queue, the next ReadKeyStroke reads the queued key instead of the new one. If the user presses "Enter", MokManager exits directly without showing the menu again. --- MokManager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MokManager.c b/MokManager.c index bfcbfd67..97588cb6 100644 --- a/MokManager.c +++ b/MokManager.c @@ -1241,6 +1241,9 @@ static void run_menu (CHAR16 *header, UINTN lines, struct menu_item *items, if (ret < 0) { Print(L"Press a key to continue\n"); Pause(); + /* Clear the key in the queue */ + uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, + ST->ConIn, &key); } draw_menu (header, lines, items, count); pos = 0; -- cgit v1.2.3