Browse Source

[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>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
8dd39b9572
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      src/core/getkey.c

+ 7
- 2
src/core/getkey.c View File

@@ -76,9 +76,14 @@ int getkey ( unsigned long timeout ) {
76 76
 	if ( character != ESC )
77 77
 		return character;
78 78
 
79
+	character = getchar_timeout ( GETKEY_TIMEOUT );
80
+	if ( character < 0 )
81
+		return ESC;
82
+
83
+	if ( isalpha ( character ) )
84
+		return ( toupper ( character ) - 'A' + 1 );
85
+
79 86
 	while ( ( character = getchar_timeout ( GETKEY_TIMEOUT ) ) >= 0 ) {
80
-		if ( character == '[' )
81
-			continue;
82 87
 		if ( isdigit ( character ) ) {
83 88
 			n = ( ( n * 10 ) + ( character - '0' ) );
84 89
 			continue;

Loading…
Cancel
Save