Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
mcb30 committed May 25, 2016
1 parent f42b258 commit 8dd39b9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/getkey.c
Expand Up @@ -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;
Expand Down

0 comments on commit 8dd39b9

Please sign in to comment.