diff options
author | Michael Brown | 2016-05-25 16:51:36 +0200 |
---|---|---|
committer | Michael Brown | 2016-05-26 00:28:41 +0200 |
commit | 8dd39b95723af0aac20d16316d16f306d8394af2 (patch) | |
tree | b46e310a1bd96e172ed0308db098f6fac1c9c3b7 /src/core | |
parent | [http] Ignore unrecognised "Connection" header tokens (diff) | |
download | ipxe-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')
-rw-r--r-- | src/core/getkey.c | 9 |
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; |