X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Faction.c;h=b9040f5b7c6cbf0b45820625193f80af2ee270f7;hb=163c66d019a8fd22e437394f4ee1450f70245b93;hp=ec8eeae7bc8b7bfb6f8e372ce9acc097b4351948;hpb=79cfa894afbc0a94ac642f57de905d9afc068ce7;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index ec8eeae7..b9040f5b 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -26,6 +26,7 @@ along with this program. If not, see . #include "action_macro.h" #include "action_util.h" #include "action.h" +#include "hook.h" #ifdef DEBUG_ACTION #include "debug.h" @@ -39,6 +40,7 @@ void action_exec(keyevent_t event) if (!IS_NOEVENT(event)) { dprint("\n---- action_exec: start -----\n"); dprint("EVENT: "); debug_event(event); dprintln(); + hook_matrix_change(event); } keyrecord_t record = { .event = event }; @@ -131,10 +133,17 @@ void process_action(keyrecord_t *record) case MODS_TAP_TOGGLE: if (event.pressed) { if (tap_count <= TAPPING_TOGGLE) { - register_mods(mods); + if (mods & get_mods()) { + dprint("MODS_TAP_TOGGLE: toggle mods off\n"); + unregister_mods(mods); + } else { + dprint("MODS_TAP_TOGGLE: toggle mods on\n"); + register_mods(mods); + } } } else { if (tap_count < TAPPING_TOGGLE) { + dprint("MODS_TAP_TOGGLE: release : unregister_mods\n"); unregister_mods(mods); } } @@ -518,7 +527,12 @@ bool is_tap_key(keypos_t key) case ACT_RMODS_TAP: case ACT_LAYER_TAP: case ACT_LAYER_TAP_EXT: - return true; + switch (action.layer_tap.code) { + case 0x00 ... 0xdf: + case OP_TAP_TOGGLE: + return true; + } + return false; case ACT_MACRO: case ACT_FUNCTION: if (action.func.opt & FUNC_TAP) { return true; }