From: Michael Brown Date: Thu, 10 Feb 2022 12:14:46 +0000 (+0000) Subject: [efi] Support keyboard remapping via the EFI console X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0979b3a11ddd642b047c7e9240cefc0144c595c7;p=thirdparty%2Fipxe.git [efi] Support keyboard remapping via the EFI console Signed-off-by: Michael Brown --- 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 |