Browse Source

Added SPLIT_LAYER_STATE_SET option to invoke layer_state_set_kb and default_layer_state_set_kb on slave keyboard when state changes.

This allows actions attached to these functions to be invoked on the slave side - for example, RGB light changes
or haptic feedback.
pull/16232/head
Henry Bucklow 2 years ago
parent
commit
fc7587b672
1 changed files with 14 additions and 2 deletions
  1. +14
    -2
      quantum/split_common/transactions.c

+ 14
- 2
quantum/split_common/transactions.c View File

@ -264,8 +264,20 @@ static bool layer_state_handlers_master(matrix_row_t master_matrix[], matrix_row
}
static void layer_state_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
layer_state = split_shmem->layers.layer_state;
default_layer_state = split_shmem->layers.default_layer_state;
if (layer_state != split_shmem->layers.layer_state) {
layer_state = split_shmem->layers.layer_state;
#if defined(SPLIT_LAYER_STATE_SET)
layer_state = layer_state_set_kb(layer_state);
#endif
}
if (default_layer_state != split_shmem->layers.default_layer_state) {
default_layer_state = split_shmem->layers.default_layer_state;
#if defined(SPLIT_LAYER_STATE_SET)
default_layer_state = default_layer_state_set_kb(default_layer_state);
#endif
}
}
// clang-format off


Loading…
Cancel
Save