diff options
author | Michael Brown <mcb30@ipxe.org> | 2016-05-25 15:51:36 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-05-25 23:28:41 +0100 |
commit | 8dd39b95723af0aac20d16316d16f306d8394af2 (patch) | |
tree | b46e310a1bd96e172ed0308db098f6fac1c9c3b7 /src/core/getkey.c | |
parent | f42b2585fe81903488c3c1560089457e860241d4 (diff) | |
download | ipxe-8dd39b95723af0aac20d16316d16f306d8394af2.zip ipxe-8dd39b95723af0aac20d16316d16f306d8394af2.tar.gz ipxe-8dd39b95723af0aac20d16316d16f306d8394af2.tar.bz2 |
[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.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/getkey.c b/src/core/getkey.c index 0f0f8b7..0c280d2 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; |