[U-Boot] [PATCH 2/8] efi_loader: console input ESC a - ESC z

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Sep 9 18:27:17 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>
---
 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 ee84640b7c..ca68c8fc1e 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -479,7 +479,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