From: Kay Sievers Date: Sun, 25 Aug 2013 12:33:28 +0000 (+0200) Subject: fall back to SimpleTextInputProtocol if we do not actually get a key X-Git-Tag: 37~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1d3094025dada8460ca9ecfd46a363a2d30c887;p=platform%2Fupstream%2Fgummiboot.git fall back to SimpleTextInputProtocol if we do not actually get a key --- 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; }