On 27/01/2023 13:33, BALATON Zoltan wrote:
Mac OS X calls it during boot. This gets rid of an error saying "call-method slw_update_keymap failed with error ffffffdf" but otherwise does not seem to matter. It's probably used for getting the pressed keys that can change some boot actions like enable verbose mode with Cmd-V.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu
drivers/usbhid.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/usbhid.c b/drivers/usbhid.c index b8e1548..d3ad4ef 100644 --- a/drivers/usbhid.c +++ b/drivers/usbhid.c @@ -52,12 +52,20 @@ keyboard_close(int *idx) { }
+static void +keyboard_get_key_map(void) +{
- static char keytable[32] = { 0 };
- PUSH(pointer2cell(keytable));
+}
static void keyboard_read(void);
NODE_METHODS( usb_kbd ) = { { "open", keyboard_open }, { "close", keyboard_close }, { "read", keyboard_read },
{ "get-key-map", keyboard_get_key_map }, };
#ifdef CONFIG_DEBUG_USB
It looks like the ADB version is similar, apart from it also has this comment:
/* Debugging BootX: the lines below force get-key-map to report that * cmd-V is being held down, which forces BootX to run in verbose mode * for debugging. * * TODO: if we can find a mapping between the get-key-map bitmap and * ADB scancodes, the keyboard driver should be altered to update this * accordingly. */
/* kbd->keytable[3] = 0x40; kbd->keytable[28] = 0x10;
Might be worth adding a similar comment (and maybe even testing it) for the USB version, but regardless:
Reviewed-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
ATB,
Mark.