Hybrid Keyboard Descriptor supports Boot & NKRO

This information is slightly out of date! The format of boot.py was modified in 7.0.0-rc.0 and newer

It has been suggested that it's possible to have both N-key rollover (NKRO) and be compatible with computer early boot screens (BIOS/UEFI/etc) by ensuring that the first 8 bytes of the report are compatible with the standard keyboard protocol.

On the heels of my earlier experience with how easy CircuitPython 7 made it to try a custom descriptor for NKRO, I tried implementing this too. And it works! On a sample of one Dell notebook computer, the hybrid descriptor can navigate in the boot menu but also enjoys full NKRO once Linux has booted.

You have to configure the descriptor in boot.py and then use the HybridKeyboard class in your code. It is compatible with the adafruit_hid.keyboard.Keyboard class, except that if you ask it to press more than 6 keys in a row, it doesn't throw an exception!

The original NKRO descriptor is also in this boot.py, in case you want to try both and compare how they work for you; code.py is intended to auto-select the correct interface class. Remember that you need to fully restart the Feather when modifying boot.py!

The first file below is boot.py and the second is code.py, and the code is designed for an Adafruit Feather RP2040 with custom 4x5 keypad, detailed in a Learning System guide.




Entry first conceived on 13 July 2021, 21:05 UTC, last modified on 8 September 2021, 17:35 UTC
Website Copyright © 2004-2021 Jeff Epler