Quellcode durchsuchen

[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 vor 8 Jahren
Ursprung
Commit
8dd39b9572
1 geänderte Dateien mit 7 neuen und 2 gelöschten Zeilen
  1. 7
    2
      src/core/getkey.c

+ 7
- 2
src/core/getkey.c Datei anzeigen

@@ -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;

Laden…
Abbrechen
Speichern