From f1d3094025dada8460ca9ecfd46a363a2d30c887 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 25 Aug 2013 14:33:28 +0200 Subject: [PATCH] fall back to SimpleTextInputProtocol if we do not actually get a key --- src/efi/gummiboot.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c index f7e4d40..f883087 100644 --- a/src/efi/gummiboot.c +++ b/src/efi/gummiboot.c @@ -355,6 +355,7 @@ static EFI_STATUS key_read(UINT64 *key, BOOLEAN wait) { static BOOLEAN checked; EFI_KEY_DATA keydata; UINT32 shift = 0; + UINT64 keypress; UINTN index; EFI_STATUS err; @@ -411,7 +412,14 @@ fallback: }; /* 32 bit modifier keys + 16 bit scan code + 16 bit unicode */ - *key = KEYPRESS(shift, keydata.Key.ScanCode, keydata.Key.UnicodeChar); + keypress = KEYPRESS(shift, keydata.Key.ScanCode, keydata.Key.UnicodeChar); + if (keypress == 0) { + /* some firmware exposes SimpleTextInputExProtocol, but it doesn't work */ + TextInputEx = NULL; + goto fallback; + } + + *key = keypress; return 0; } -- 2.7.4