Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Keyboard Led status codes #61

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

PJ789
Copy link
Contributor

@PJ789 PJ789 commented Dec 26, 2021

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

KeyboardLayout_da_DK.cpp is Danish keyboard layout
Keyboard.h references da_DK.cpp
Keyboard_da_DK.h defines scan codes for Danish characters such as ÆØ.
Changed scan code for bslash as suggested by @edgar-bonnet
@per1234 per1234 added the type: enhancement Proposed improvement label Dec 26, 2021
@PJ789
Copy link
Contributor Author

PJ789 commented Dec 26, 2021

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
Copy link
Contributor Author

PJ789 commented Dec 26, 2021

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

`

src/Keyboard.h Outdated Show resolved Hide resolved
src/Keyboard.cpp Outdated Show resolved Hide resolved
@per1234 per1234 added topic: code Related to content of the project itself status: blocked Progress on this prevented by an external cause labels Mar 6, 2022
@per1234 per1234 linked an issue Mar 6, 2022 that may be closed by this pull request
@60999
Copy link

60999 commented May 8, 2022

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

@PJ789
Copy link
Contributor Author

PJ789 commented May 9, 2022

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

@AllCheeks
Copy link

AllCheeks commented Jun 18, 2022

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

Cemu0 added a commit to Cemu0/ESP32-BLE-Keyboard that referenced this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked Progress on this prevented by an external cause topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow retrieving Caps/Num/Scroll Lock Status
5 participants