]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[usb] Support keyboard remapping via the native USB keyboard driver
authorMichael Brown <mcb30@ipxe.org>
Wed, 9 Feb 2022 21:54:47 +0000 (21:54 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 10 Feb 2022 13:11:27 +0000 (13:11 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/usb/usbkbd.c

index a8ab6ab76bd83ce59c954b1f079e236ad835f293..397ed77ec82945c0f8ed03492f93b8a3c8f410be 100644 (file)
@@ -29,6 +29,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <assert.h>
 #include <ipxe/console.h>
 #include <ipxe/keys.h>
+#include <ipxe/keymap.h>
 #include <ipxe/usb.h>
 #include "usbkbd.h"
 
@@ -122,6 +123,10 @@ static unsigned int usbkbd_map ( unsigned int keycode, unsigned int modifiers,
                key = 0;
        }
 
+       /* Remap key if applicable */
+       if ( keycode < USBKBD_KEY_CAPS_LOCK )
+               key = key_remap ( key );
+
        return key;
 }