Kaleidoscope
layers.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Arduino.h>
4 #include "key_defs.h"
5 #include KALEIDOSCOPE_HARDWARE_H
6 
7 class Layer_ {
8  public:
9  Layer_(void);
10 
11  static Key lookup(byte row, byte col) {
12  return keyMap[row][col];
13  }
14  static void on(uint8_t layer);
15  static void off(uint8_t layer);
16  static void move(uint8_t layer);
17 
18  static uint8_t top(void);
19  static void next(void);
20  static void previous(void);
21 
22  static boolean isOn(uint8_t layer);
23 
24  static void defaultLayer(uint8_t layer);
25  static uint8_t defaultLayer(void);
26 
27  static uint32_t getLayerState(void);
28 
29  static Key eventHandler(Key mappedKey, byte row, byte col, uint8_t keyState);
30 
31  static Key(*getKey)(uint8_t layer, byte row, byte col);
32 
33  static Key getKeyFromPROGMEM(uint8_t layer, byte row, byte col);
34 
35  static void updateKeyCache(byte row, byte col);
36 
37  private:
38  static uint8_t highestLayer;
39  static Key keyMap[ROWS][COLS];
40 };
41 
42 Key layer_getKey(uint8_t layer, uint8_t r, uint8_t c);
43 
44 extern Layer_ Layer;
#define ROWS
Definition: Kaleidoscope-Hardware-Model01.h:9
static void updateKeyCache(byte row, byte col)
Definition: layers.cpp:65
static uint32_t getLayerState(void)
Definition: layers.cpp:129
Key layer_getKey(uint8_t layer, uint8_t r, uint8_t c)
Layer_(void)
Definition: layers.cpp:51
static uint8_t top(void)
Definition: layers.cpp:83
static uint8_t defaultLayer(void)
Definition: layers.cpp:125
static void on(uint8_t layer)
Definition: layers.cpp:96
static Key lookup(byte row, byte col)
Definition: layers.h:11
byte byte col
Definition: TapDance.cpp:229
static void next(void)
Definition: layers.cpp:112
Definition: key_defs.h:13
static void previous(void)
Definition: layers.cpp:116
static Key eventHandler(Key mappedKey, byte row, byte col, uint8_t keyState)
Definition: layers.cpp:43
union Key_ Key
#define COLS
Definition: Kaleidoscope-Hardware-Model01.h:8
byte row
Definition: TapDance.cpp:229
static void off(uint8_t layer)
Definition: layers.cpp:102
Layer_ Layer
Definition: layers.cpp:133
static boolean isOn(uint8_t layer)
Definition: layers.cpp:108
static Key getKeyFromPROGMEM(uint8_t layer, byte row, byte col)
Definition: layers.cpp:56
static Key(* getKey)(uint8_t layer, byte row, byte col)
Definition: layers.h:31
static void move(uint8_t layer)
Definition: layers.cpp:91
uint8_t keyState
Definition: Kaleidoscope-Macros.cpp:5
Definition: layers.h:7