diff options
Diffstat (limited to 'quantum/action_layer.h')
| -rw-r--r-- | quantum/action_layer.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/quantum/action_layer.h b/quantum/action_layer.h index 3fe2726529..ff783bb3e7 100644 --- a/quantum/action_layer.h +++ b/quantum/action_layer.h | |||
| @@ -113,6 +113,25 @@ void layer_and(layer_state_t state); | |||
| 113 | void layer_xor(layer_state_t state); | 113 | void layer_xor(layer_state_t state); |
| 114 | layer_state_t layer_state_set_user(layer_state_t state); | 114 | layer_state_t layer_state_set_user(layer_state_t state); |
| 115 | layer_state_t layer_state_set_kb(layer_state_t state); | 115 | layer_state_t layer_state_set_kb(layer_state_t state); |
| 116 | |||
| 117 | /** | ||
| 118 | * @brief Applies the tri layer to global layer state. Not be used in layer_state_set_(kb|user) functions. | ||
| 119 | * | ||
| 120 | * @param layer1 First layer to check for tri layer | ||
| 121 | * @param layer2 Second layer to check for tri layer | ||
| 122 | * @param layer3 Layer to activate if both other layers are enabled | ||
| 123 | */ | ||
| 124 | void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); | ||
| 125 | /** | ||
| 126 | * @brief Applies the tri layer behavior to supplied layer bitmask, without using layer functions. | ||
| 127 | * | ||
| 128 | * @param state Original layer bitmask to check and modify | ||
| 129 | * @param layer1 First layer to check for tri layer | ||
| 130 | * @param layer2 Second layer to check for tri layer | ||
| 131 | * @param layer3 Layer to activate if both other layers are enabled | ||
| 132 | * @return layer_state_t returns a modified layer bitmask with tri layer modifications applied | ||
| 133 | */ | ||
| 134 | layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); | ||
| 116 | #else | 135 | #else |
| 117 | # define layer_state 0 | 136 | # define layer_state 0 |
| 118 | 137 | ||
| @@ -131,6 +150,8 @@ layer_state_t layer_state_set_kb(layer_state_t state); | |||
| 131 | # define layer_xor(state) (void)state | 150 | # define layer_xor(state) (void)state |
| 132 | # define layer_state_set_kb(state) (void)state | 151 | # define layer_state_set_kb(state) (void)state |
| 133 | # define layer_state_set_user(state) (void)state | 152 | # define layer_state_set_user(state) (void)state |
| 153 | # define update_tri_layer(layer1, layer2, layer3) | ||
| 154 | # define update_tri_layer_state(state, layer1, layer2, layer3) (void)state | ||
| 134 | #endif | 155 | #endif |
| 135 | 156 | ||
| 136 | /* pressed actions cache */ | 157 | /* pressed actions cache */ |
