Leonardo Keyboard Library: Support for in-BIOS-keyboard ?

(As the title indicates, this is about the Arduino Leonardo Keyboard Library. I would have put it in another section of the forum, but the link in the Keyboard Reference sent me here.)

Good afternoon forum,
so, I am trying to use an Arduino Micro to send keystrokes to the BIOS so that I can automate a "boot from USB-Stick" procedure without having to connect keyboard and screen. I am testing this in a text editor window, and the Micro is "typing" the things I want. I added a pushbutton to the Micro so that I can "start" the procedure with proper timings, the L13 feedback shows me that the software on the Micro is working well and timings are okay, but the BIOS does not recognize any key presses.
The system (mainboard/BIOS) generally works with USB Keyboards. I have a USB-Keyboard connected which I can use for the BIOS, and I have also tried the Micro with my USB-Keyboard disconnected.

I suppose this is related to the various emulation modes that exist in this arcane part of PCs/BIOS. I have had it in the past with other keyboards and other BIOSes, that a USB Keyboard/or a Keyboard on an adapter would work well in the booted Operating System, but would act up/not be recognized in BIOS/early boot.

The same problem is described here on StackOverflow: hid - Generic keyboard emulation using Arduino Leonardo - Stack Overflow but there is no solution/no accepted answer. I have also tried to set the deviceSubClass to 1 as suggested, but no change (still works in text editor, still not in BIOS).

Any helps/hints would be greatly appreciated, thanks for helping.

Reasons why I try/have to do it this way:

  • I do not want to boot from the USB Stick on every single boot. Only sometimes. So I cannot just leave the stick inserted and have the system boot order configured to the USB flashdrive.
  • As soon as I remove the USB Stick, it disappears from the Boot Device List, so I cannot have the system automatically boot from USB if present or continue to boot regular if not.
  • I cannot change the mainboard hardware, the BIOS or the BIOS version, so (U)EFI is not an option atm.

Any success on this? Any Idea?

Thanks a lot!!!

I suspect the bios doesn't like seeing two keyboards.

westfw:
I suspect the bios doesn't like seeing two keyboards.

I tried it out. I thought I knew the answer, but I wanted to be sure. I connected two keyboards at the same time, which both work alone/independently, and they both sure worked at the same time in BIOS.

No, it's rather that BIOS is rather peculiar with keyboards and emulations etc. By far not all keyboards work in BIOS or even all ports. On a recent motherboard we acquired at work, there is ONE usb port in another color (green) which is supposed to be the BIOS keyboard port, and sure, no keyboard works in any of the other ports and, of course, not even all keyboards work in that green port...

I know this is a very old thread I'm bringing back into life, but I was wondering if anyone has figured out the solution to this?

I have a micro that we use to set up BIOS settings on hundreds of computers in a highschool.

Some models of dell computers recognize my micro as a USB keyboard and work fine in the bios, while other models do not detect the micro.

Inside of windows everything works fine, of course.

Thank you guys!

Try a Teensy which does a better job of emulating USB devices.

An alternative is to start hacking the AVR board package files to change the USB keyboard device descriptors. If you dump out the USB descriptors for a Leonardo, Micro, or Pro Micro emulating a keyboard and compare against USB descriptors from a real USB keyboard, you will see many differences. The differences are why Arduino keyboard emulation does not work in the BIOS.

gdsports:
Try a Teensy which does a better job of emulating USB devices.

An alternative is to start hacking the AVR board package files to change the USB keyboard device descriptors. If you dump out the USB descriptors for a Leonardo, Micro, or Pro Micro emulating a keyboard and compare against USB descriptors from a real USB keyboard, you will see many differences. The differences are why Arduino keyboard emulation does not work in the BIOS.

Thank you for the detailed explanation.
Cheers!

There is a bit more discussion on this thread. I modified the core Arduino files for USB keyboard which did help on the problem I was trying to solve. It may work for you.

https://forum.arduino.cc/index.php?topic=545288.msg3717028#msg3717028

Teensy USB keyboard emulation is much better so it should work in BIOS but I have not verified this myself.