Keyboard
Keyboard copied to clipboard
Added support for Keyboard Led status codes
This pull request adds support for LED status reports from the host, based on code here, with some minor enhancements for legibility sake;- https://forum.arduino.cc/t/leonardo-keyboard-leds-emulation/169582/23
Note this pull request has dependencies on another pull request in the ArduinoCore-avr HID library;-
ArduinoCore-avr pull request 446
... and will not compile unless & until that dependency is approved.
Usage example;-
`
if (Keyboard.getLedStatus(LED_CAPS_LOCK))
{
Serial.print("Cap Lock on ");
}
if (Keyboard.getLedStatus(LED_SCROLL_LOCK))
{
Serial.print("Scroll Lock on ");
}
if (Keyboard.getLedStatus(LED_NUM_LOCK))
{
Serial.print("Num Lock on ");
}
Serial.println();
`
Excuse me, what's the progress now? Has the problem been solved?
@60999 ... the code does work (I have a keyboard based on the changed code I use daily) but requires you to patch the Keyboard library AND ArduinoCore-avr HID library too (and I suspect that is why it is marked blocked, because the dependency on the core library code).
Applying the two patches is easy enough to do, assuming you're confident about overwriting the two affected libraries with the submitted code.
@60999 ... the code does work (I have a keyboard based on the changed code I use daily) but requires you to patch the Keyboard library AND ArduinoCore-avr HID library too (and I suspect that is why it is marked blocked, because the dependency on the core library code).
Applying the two patches is easy enough to do, assuming you're confident about overwriting the two affected libraries with the submitted code.
It turns out that you also noticed this small detail awesome!