From 8dd39b95723af0aac20d16316d16f306d8394af2 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 25 May 2016 15:51:36 +0100 Subject: [PATCH] [efi] Work around broken UEFI keyboard drivers Some UEFI keyboard drivers are blissfully unaware of the existence of either Ctrl key, and will report "Ctrl-" as just "". This breaks substantial portions of the iPXE user interface. Work around these broken UEFI drivers by allowing "ESC " to be used as a substitute for "Ctrl-". Tested-by: Dreamcat4 Signed-off-by: Michael Brown --- src/core/getkey.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/getkey.c b/src/core/getkey.c index 0f0f8b7c..0c280d23 100644 --- a/src/core/getkey.c +++ b/src/core/getkey.c @@ -76,9 +76,14 @@ int getkey ( unsigned long timeout ) { if ( character != ESC ) return character; + character = getchar_timeout ( GETKEY_TIMEOUT ); + if ( character < 0 ) + return ESC; + + if ( isalpha ( character ) ) + return ( toupper ( character ) - 'A' + 1 ); + while ( ( character = getchar_timeout ( GETKEY_TIMEOUT ) ) >= 0 ) { - if ( character == '[' ) - continue; if ( isdigit ( character ) ) { n = ( ( n * 10 ) + ( character - '0' ) ); continue;