From 0979b3a11ddd642b047c7e9240cefc0144c595c7 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 10 Feb 2022 12:14:46 +0000 Subject: [PATCH] [efi] Support keyboard remapping via the EFI console Signed-off-by: Michael Brown --- src/interface/efi/efi_console.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/interface/efi/efi_console.c b/src/interface/efi/efi_console.c index 98ebbf3ac..874f54b6c 100644 --- a/src/interface/efi/efi_console.c +++ b/src/interface/efi/efi_console.c @@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include #include #include @@ -317,6 +318,13 @@ static int efi_getchar ( void ) { key.KeyState.KeyToggleState, key.Key.UnicodeChar, key.Key.ScanCode ); + /* Remap key. There is unfortunately no way to avoid + * remapping the numeric keypad, since EFI destroys the scan + * code information that would allow us to differentiate + * between main keyboard and numeric keypad. + */ + key.Key.UnicodeChar = key_remap ( key.Key.UnicodeChar ); + /* Translate Ctrl- */ if ( ( key.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID ) && ( key.KeyState.KeyShiftState & ( EFI_LEFT_CONTROL_PRESSED | -- 2.47.2