From ade8a0f1d11068161243e5d2ebfe2942f5561ad7 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Tue, 17 Dec 2019 08:30:11 +0000 Subject: loader.efi: efi_readkey_ex needs to key despite the shift status or toggle status From UEFI specification 2.8, page 434: "It should also be noted that certain input devices may not be able to produce shift or toggle state information, and in those cases the high order bit in the respective Toggle and Shift state fields should not be active." But we still need to check for ScanCode and UnicodeChar. PR: 242660 Reported by: Trond Endrestol MFC after: 1 week --- stand/efi/libefi/efi_console.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'stand/efi/libefi/efi_console.c') 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); } -- cgit v1.2.3