summaryrefslogtreecommitdiffstats
path: root/src/core/getkey.c
diff options
context:
space:
mode:
authorMichael Brown2016-05-25 16:51:36 +0200
committerMichael Brown2016-05-26 00:28:41 +0200
commit8dd39b95723af0aac20d16316d16f306d8394af2 (patch)
treeb46e310a1bd96e172ed0308db098f6fac1c9c3b7 /src/core/getkey.c
parent[http] Ignore unrecognised "Connection" header tokens (diff)
downloadipxe-8dd39b95723af0aac20d16316d16f306d8394af2.tar.gz
ipxe-8dd39b95723af0aac20d16316d16f306d8394af2.tar.xz
ipxe-8dd39b95723af0aac20d16316d16f306d8394af2.zip
[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-<key>" as just "<key>". This breaks substantial portions of the iPXE user interface. Work around these broken UEFI drivers by allowing "ESC <key>" to be used as a substitute for "Ctrl-<key>". Tested-by: Dreamcat4 <dreamcat4@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/getkey.c')
-rw-r--r--src/core/getkey.c9
1 files 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;