[U-Boot] [PATCH v2 07/13] efi_loader: console input ESC a - ESC z

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Sep 10 19:49:31 UTC 2018


We have foreseen a work around for entering control codes in the
EFI_SIMPLE_TEXT_INPUT_PROTOCOL. But currently we have an offset of one.

ESC a should translate to 0x01 (CTRL+a).
ESC z should translate to 0x1a (CTRL+z).

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
v2
	no change
---
 lib/efi_loader/efi_console.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index dfec95903e..4b97f6ebbc 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -473,7 +473,12 @@ static efi_status_t efi_cin_read_key(struct efi_input_key *key)
 			pressed_key.scan_code = ch - 'P' + 11;
 			break;
 		case 'a'...'z':
-			ch = ch - 'a';
+			/*
+			 * Workaround for entering CTRL+a (0x01) - CTRL+z (0x1a)
+			 * as escape sequence if the terminal does not allow
+			 * direct entry. These are not Xterm control sequences.
+			 */
+			ch = ch - 'a' + 1;
 			break;
 		case '[':
 			ch = getc();
-- 
2.18.0



More information about the U-Boot mailing list