Skip to content

Commit 8dd39b9

Browse files
committed
[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>
1 parent f42b258 commit 8dd39b9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/core/getkey.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,14 @@ int getkey ( unsigned long timeout ) {
7676
if ( character != ESC )
7777
return character;
7878

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+
7986
while ( ( character = getchar_timeout ( GETKEY_TIMEOUT ) ) >= 0 ) {
80-
if ( character == '[' )
81-
continue;
8287
if ( isdigit ( character ) ) {
8388
n = ( ( n * 10 ) + ( character - '0' ) );
8489
continue;

0 commit comments

Comments
 (0)