vial/tap-dance: allow complex keycodes

This commit is contained in:
Ilya Zhuravlev
2021-07-03 19:48:01 -04:00
parent 274d9dcf07
commit e0c7388e5d
4 changed files with 82 additions and 57 deletions

View File

@ -10,6 +10,10 @@
# include "nodebug.h"
#endif
#ifdef VIAL_ENABLE
#include "vial.h"
#endif
/** \brief Default Layer State
*/
layer_state_t default_layer_state = 0;
@ -192,6 +196,10 @@ uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS]
* Updates the cached keys when changing layers
*/
void update_source_layers_cache(keypos_t key, uint8_t layer) {
#ifdef VIAL_ENABLE
if (key.row == VIAL_MATRIX_MAGIC) return;
#endif
const uint8_t key_number = key.col + (key.row * MATRIX_COLS);
const uint8_t storage_row = key_number / 8;
const uint8_t storage_bit = key_number % 8;
@ -206,6 +214,10 @@ void update_source_layers_cache(keypos_t key, uint8_t layer) {
* reads the cached keys stored when the layer was changed
*/
uint8_t read_source_layers_cache(keypos_t key) {
#ifdef VIAL_ENABLE
if (key.row == VIAL_MATRIX_MAGIC) return 0;
#endif
const uint8_t key_number = key.col + (key.row * MATRIX_COLS);
const uint8_t storage_row = key_number / 8;
const uint8_t storage_bit = key_number % 8;