aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-02-09 21:54:47 +0000
committerMichael Brown <mcb30@ipxe.org>2022-02-10 13:11:27 +0000
commit468980db2b99f54ffec7d2a44c281308b4eec3c0 (patch)
tree9598557d0fb92983a64ff6528a208732b6560b8b
parentfa708015e545a5877b1c07e2acf40f25b333c2cd (diff)
downloadipxe-468980db2b99f54ffec7d2a44c281308b4eec3c0.zip
ipxe-468980db2b99f54ffec7d2a44c281308b4eec3c0.tar.gz
ipxe-468980db2b99f54ffec7d2a44c281308b4eec3c0.tar.bz2
[usb] Support keyboard remapping via the native USB keyboard driver
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/drivers/usb/usbkbd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/usb/usbkbd.c b/src/drivers/usb/usbkbd.c
index a8ab6ab..397ed77 100644
--- a/src/drivers/usb/usbkbd.c
+++ b/src/drivers/usb/usbkbd.c
@@ -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;
}