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_LayerHoldShift.h 989B

12345678910111213141516171819202122232425262728293031
  1. #ifndef CODE_LAYERHOLDSHIFT_H
  2. #define CODE_LAYERHOLDSHIFT_H
  3. #include <inttypes.h>
  4. #include "Code.h"
  5. #include "LayerState.h"
  6. #include "Code_Shift.h"
  7. /* Code_LayerHoldShift calls LayerState when pressed to change activeLayer.
  8. When a Code_LayerHoldShift object is pressed or released, it:
  9. * sends scancode in refCodeShift
  10. * calls LayerState to change activeLayer
  11. Codes defined in sketch would be Code_Sc and Code_ScNS
  12. (Code_ScS is not need because refCodeShift sends the shift scancode).
  13. */
  14. class Code_LayerHoldShift : public Code
  15. {
  16. private:
  17. const uint8_t layerId;
  18. LayerState& refLayerState;
  19. Code_Shift& refCodeShift;
  20. public:
  21. Code_LayerHoldShift(const uint8_t layerId, LayerState& refLayerState,
  22. Code_Shift& refCodeShift)
  23. : layerId(layerId), refLayerState(refLayerState),
  24. refCodeShift(refCodeShift) {}
  25. virtual void press();
  26. virtual void release();
  27. };
  28. #endif