瀏覽代碼

[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 年之前
父節點
當前提交
8dd39b9572
共有 1 個檔案被更改,包括 7 行新增2 行删除
  1. 7
    2
      src/core/getkey.c

+ 7
- 2
src/core/getkey.c 查看文件

@@ -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…
取消
儲存