mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-13 23:44:54 +00:00
Update action.c
This commit is contained in:
parent
9a35f01c55
commit
420fc8620b
1 changed files with 6 additions and 6 deletions
|
@ -82,18 +82,18 @@ action_t store_or_get_action(bool pressed, keypos_t key)
|
|||
if (disable_action_cache) {
|
||||
return layer_switch_get_action(key);
|
||||
}
|
||||
uint8_t key_number = key.col + (key.row * MATRIX_COLS);
|
||||
uint8_t storage_row = key_number / 8;
|
||||
uint8_t storage_bit = key_number % 8;
|
||||
uint8_t layer;
|
||||
int8_t key_number = key.col + (key.row * MATRIX_COLS);
|
||||
int8_t storage_row = key_number / 8;
|
||||
int8_t storage_bit = key_number % 8;
|
||||
int8_t layer;
|
||||
if (pressed) {
|
||||
layer = layer_switch_get_layer(key);
|
||||
for (uint8_t bit_number = 0; bit_number <= 4; bit_number++) {
|
||||
for (int8_t bit_number = 0; bit_number <= 4; bit_number++) {
|
||||
source_layers_cache[bit_number][storage_row] ^= (-(!!(layer & (1 << bit_number)) ^ source_layers_cache[bit_number][storage_row])) & (1 << storage_bit);
|
||||
}
|
||||
} else {
|
||||
layer = 0;
|
||||
for (uint8_t bit_number = 0; bit_number <= 4; bit_number++) {
|
||||
for (int8_t bit_number = 0; bit_number <= 4; bit_number++) {
|
||||
layer |= (!!(source_layers_cache[bit_number][storage_row] & (1 << storage_bit))) << bit_number;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue