keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

Code_LayeredScScBase.h 771B

1234567891011121314151617181920212223242526
  1. #ifndef CODE_LAYERED2SCANCODES_H
  2. #define CODE_LAYERED2SCANCODES_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include "Code.h"
  6. /* Class Code_LayeredScScBase is an abstract base class. It is composed of two scancodes:
  7. if layer=0, send scancode0
  8. if layer=1, send scancode1
  9. */
  10. class Code_LayeredScScBase : public Code
  11. {
  12. private:
  13. const uint16_t scancode0;
  14. const uint16_t scancode1;
  15. uint16_t scancode;
  16. protected:
  17. bool layer; //0 or 1
  18. public:
  19. Code_LayeredScScBase(const uint16_t scancode0, const uint16_t scancode1):
  20. scancode0(scancode0), scancode1(scancode1), layer(0) { }
  21. virtual void press()=0;
  22. virtual void release();
  23. void pressScancode();
  24. };
  25. #endif