[U-Boot] [PATCH 1/1] efi_loader: alternative scan codes for F5, HOME

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Jun 16 21:34:01 UTC 2019


Depending on the key board alternative scan codes are used for F5 and HOME.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 lib/efi_loader/efi_console.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 2fc25e118f..009dbfc724 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -567,7 +567,10 @@ static efi_status_t efi_cin_read_key(struct efi_key_data *key)
 		case 'O': /* F1 - F4 */
 			ch = getc();
 			/* consider modifiers */
-			if (ch < 'P') {
+			if (ch == 'F') {
+				pressed_key.scan_code = 5; /* Home */
+				break;
+			} else if (ch < 'P') {
 				set_shift_mask(ch - '0', &key->key_state);
 				ch = getc();
 			}
@@ -591,17 +594,20 @@ static efi_status_t efi_cin_read_key(struct efi_key_data *key)
 				case '1'...'5': /* F1 - F5 */
 					pressed_key.scan_code = ch - '1' + 11;
 					break;
-				case '7'...'9': /* F6 - F8 */
-					pressed_key.scan_code = ch - '7' + 16;
+				case '6'...'9': /* F5 - F8 */
+					pressed_key.scan_code = ch - '6' + 15;
 					break;
 				case 'A'...'D': /* up, down right, left */
 					pressed_key.scan_code = ch - 'A' + 1;
 					break;
-				case 'F':
-					pressed_key.scan_code = 6; /* End */
+				case 'F': /* End */
+					pressed_key.scan_code = 6;
+					break;
+				case 'H': /* Home */
+					pressed_key.scan_code = 5;
 					break;
-				case 'H':
-					pressed_key.scan_code = 5; /* Home */
+				case '~': /* Home */
+					pressed_key.scan_code = 5;
 					break;
 				}
 				break;
--
2.20.1



More information about the U-Boot mailing list