keybrd library is an open source library for creating custom-keyboard firmware.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。

Code_LEDLock.h 997B

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