keybrd library is an open source library for creating custom-keyboard firmware.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

1234567891011121314151617181920212223242526272829303132
  1. #ifndef CODE_LEDLOCK_H
  2. #define CODE_LEDLOCK_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include "Code.h"
  6. #include "LEDInterface.h"
  7. extern volatile uint8_t keyboard_leds;
  8. /* Class Code_LEDLock turns LED on and off
  9. scancode is KEY_CAPS_LOCK, KEY_SCROLL_LOCK, or KEY_NUM_LOCK
  10. In keybrd sketch, ports should be instantiated before Code_LEDLock is instantiated
  11. because LED.off() needs ports to be configured by port constructor.
  12. If a key does not have an LED indictor light, use Code_S instead e.g.:
  13. Code_S CapsLck(KEY_CAPS_LOCK);
  14. */
  15. class Code_LEDLock : public Code
  16. {
  17. private:
  18. const uint16_t scancode;
  19. uint8_t USB_LED_bit; //codes used by keyboard output report
  20. LEDInterface& refLED; //indicator on keyboard
  21. void updateLED() const;
  22. public:
  23. Code_LEDLock(const uint16_t scancode, LEDInterface& refLED);
  24. virtual void press();
  25. virtual void release();
  26. };
  27. #endif