X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Faction_layer.c;h=95909cc28617188be248d333c066e40b81f591fc;hb=f37805e698a34ce07f10c7f5316f9bbd2a63563b;hp=c535615f44d44a8fa669e1f86825142b9c56b616;hpb=f1f2066657f4a0998adc016c95d7e541b436e09f;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index c535615f..95909cc2 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -3,6 +3,7 @@ #include "action.h" #include "util.h" #include "action_layer.h" +#include "hook.h" #ifdef DEBUG_ACTION #include "debug.h" @@ -21,6 +22,7 @@ static void default_layer_state_set(uint32_t state) debug("default_layer_state: "); default_layer_debug(); debug(" to "); default_layer_state = state; + hook_default_layer_change(default_layer_state); default_layer_debug(); debug("\n"); clear_keyboard_but_mods(); // To avoid stuck keys } @@ -62,6 +64,7 @@ static void layer_state_set(uint32_t state) dprint("layer_state: "); layer_debug(); dprint(" to "); layer_state = state; + hook_layer_change(layer_state); layer_debug(); dprintln(); clear_keyboard_but_mods(); // To avoid stuck keys } @@ -114,8 +117,7 @@ void layer_debug(void) action_t layer_switch_get_action(keypos_t key) { - action_t action; - action.code = ACTION_TRANSPARENT; + action_t action = { .code = ACTION_TRANSPARENT }; #ifndef NO_ACTION_LAYER uint32_t layers = layer_state | default_layer_state;