keybrd library is an open source library for creating custom-keyboard firmware.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.

Key_LayeredKeysArray.h 910B

12345678910111213141516171819202122232425
  1. #ifndef KEY_LAYEREDKEYSARRAY_H
  2. #define KEY_LAYEREDKEYSARRAY_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <StateLayersInterface.h>
  6. #include <Key.h>
  7. /* Class Key_LayeredKeysArray contains an array of Key pointers, one pointer per layer.
  8. Codes are a kind of Key, so the Key pointers can point to Codes as well.
  9. When the key is pressed, active layer is retreived from refStateLayers and
  10. the Key object of the active layer is called.
  11. */
  12. class Key_LayeredKeysArray : public Key
  13. {
  14. private:
  15. Key *const *const ptrsKeys; //array of Key pointers, one Key per layer
  16. uint8_t layer; //active layer when key was pressed
  17. static StateLayersInterface& refStateLayers;
  18. public:
  19. Key_LayeredKeysArray(Key *const ptrsKeys[]): ptrsKeys(ptrsKeys) {}
  20. virtual void press();
  21. virtual void release();
  22. };
  23. #endif