mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
MdeModulePkg/BdsDxe: drain setup request input
Hotkey notifications leave a copy queued for ReadKeyStroke(). Drain it before OS-requested setup so Enter cannot immediately select Continue. Signed-off-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
parent
5e27206f82
commit
82c9a82d8f
1 changed files with 27 additions and 0 deletions
|
|
@ -276,6 +276,27 @@ BdsWaitForSingleEvent (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Drain queued console input.
|
||||||
|
|
||||||
|
**/
|
||||||
|
STATIC
|
||||||
|
VOID
|
||||||
|
BdsDrainConsoleInput (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_INPUT_KEY Key;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
while (gST->ConIn != NULL) {
|
||||||
|
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The function waits for the boot manager timeout expires or hotkey is pressed.
|
The function waits for the boot manager timeout expires or hotkey is pressed.
|
||||||
|
|
||||||
|
|
@ -1010,6 +1031,12 @@ BdsEntry (
|
||||||
BdsDxeOnConnectConInCallBack (NULL, NULL);
|
BdsDxeOnConnectConInCallBack (NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// A hotkey notification can leave the same key queued for ReadKeyStroke().
|
||||||
|
// Consume it before Enter can immediately select Continue in Front Page.
|
||||||
|
//
|
||||||
|
BdsDrainConsoleInput ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Directly enter the setup page.
|
// Directly enter the setup page.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue