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_LayerHold.h 548B

123456789101112131415161718192021
  1. #ifndef CODE_LAYERHOLD_H
  2. #define CODE_LAYERHOLD_H
  3. #include <inttypes.h>
  4. #include <Code.h>
  5. #include "StateLayers.h"
  6. /* Code_LayerHold calls StateLayers when pressed to change activeLayer.
  7. */
  8. class Code_LayerHold : public Code
  9. {
  10. private:
  11. const uint8_t layer;
  12. StateLayers& refStateLayers;
  13. public:
  14. Code_LayerHold(const uint8_t layer, StateLayers& refStateLayers)
  15. : layer(layer), refStateLayers(refStateLayers) {}
  16. virtual void press();
  17. virtual void release();
  18. };
  19. #endif