Keyboard icon indicating copy to clipboard operation
Keyboard copied to clipboard

Added support for Keyboard Led status codes

Open PJ789 opened this issue 3 years ago • 5 comments

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

PJ789 avatar Dec 26 '21 16:12 PJ789

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.

PJ789 avatar Dec 26 '21 16:12 PJ789

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();    

`

PJ789 avatar Dec 26 '21 16:12 PJ789

Excuse me, what's the progress now? Has the problem been solved?

60999 avatar May 08 '22 15:05 60999

@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.

PJ789 avatar May 09 '22 07:05 PJ789

@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!

AllCheeks avatar Jun 18 '22 11:06 AllCheeks