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_LayeredCodeScBase.h 864B

123456789101112131415161718192021222324252627
  1. #ifndef CODE_LAYEREDCODESCBASE_H
  2. #define CODE_LAYEREDCODESCBASE_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include "Code.h"
  6. /* Class Code_LayeredCodeScBase is a 2-layer code, one object for each layer e.g.
  7. layer0: ms_up //mouse up
  8. layer1: KEY_UP //up arrow
  9. When the key is pressed, the active layer is retrieved from refStateLayers,
  10. and the object for the active layer is sent to USB.
  11. */
  12. class Code_LayeredCodeScBase : public Code
  13. {
  14. private:
  15. Code& refCode0;
  16. const uint16_t scancode1;
  17. protected:
  18. bool layer;
  19. public:
  20. Code_LayeredCodeScBase(Code& refCode0, const uint16_t scancode1, uint8_t layer):
  21. refCode0(refCode0), scancode1(scancode1), layer(layer) { }
  22. virtual void press()=0;
  23. virtual void release();
  24. virtual void pressCode();
  25. };
  26. #endif