summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-08-25 14:33:28 +0200
committerKay Sievers <kay@vrfy.org>2013-08-25 14:33:28 +0200
commitf1d3094025dada8460ca9ecfd46a363a2d30c887 (patch)
tree75b2ece0801c541dc5edb5a7c3eba379b523c342
parente3b2dc6efb9043fc0f7939f26774263e4697144f (diff)
fall back to SimpleTextInputProtocol if we do not actually get a key
-rw-r--r--src/efi/gummiboot.c10
1 files changed, 9 insertions, 1 deletions
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;
}