Skip to content

Commit

Permalink
feat(split): Add keymap state sending
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Mar 21, 2024
1 parent 57bc9f3 commit 344f5b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ static inline int set_layer_state(uint8_t layer, bool state) {
// Don't send state changes unless there was an actual change
if (old_state != _zmk_keymap_layer_state) {
LOG_DBG("layer_changed: layer %d state %d", layer, state);
ret = raise_layer_state_changed(layer, state);
if (ret < 0) {
LOG_WRN("Failed to raise layer state changed (%d)", ret);
ZMK_EVENT_RAISE(create_layer_state_changed(layer, state));
#if ZMK_BLE_IS_CENTRAL
int err = zmk_split_central_send_data(DATA_TAG_KEYMAP_STATE, sizeof(uint32_t),
(uint8_t *)&_zmk_keymap_layer_state);
if (err) {
LOG_ERR("Keymap send failed (err %d)", err);
}
#endif
}

return ret;
Expand Down

0 comments on commit 344f5b6

Please sign in to comment.