diff --git a/stand/efi/libefi/efi_console.c b/stand/efi/libefi/efi_console.c index 1b73934336e9..1b096a963555 100644 --- a/stand/efi/libefi/efi_console.c +++ b/stand/efi/libefi/efi_console.c @@ -1126,11 +1126,15 @@ efi_readkey_ex(void) kp->UnicodeChar++; } } - if (kp->ScanCode == 0 && kp->UnicodeChar == 0) - return (false); - keybuf_inschar(kp); - return (true); } + /* + * The shift state and/or toggle state may not be valid, + * but we still can have ScanCode or UnicodeChar. + */ + if (kp->ScanCode == 0 && kp->UnicodeChar == 0) + return (false); + keybuf_inschar(kp); + return (true); } return (false); }