diff options
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r-- | tmk_core/common/action.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 5172e8650..f47fd20fc 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -437,20 +437,19 @@ void process_action(keyrecord_t *record, action_t action) } } break; + case ACT_LAYER_MODS: + if (event.pressed) { + layer_on(action.layer_mods.layer); + register_mods(action.layer_mods.mods); + } else { + unregister_mods(action.layer_mods.mods); + layer_off(action.layer_mods.layer); + } + break; #ifndef NO_ACTION_TAPPING case ACT_LAYER_TAP: case ACT_LAYER_TAP_EXT: switch (action.layer_tap.code) { - case 0xe0 ... 0xef: - /* layer On/Off with modifiers(left only) */ - if (event.pressed) { - layer_on(action.layer_tap.val); - register_mods(action.layer_tap.code & 0x0f); - } else { - layer_off(action.layer_tap.val); - unregister_mods(action.layer_tap.code & 0x0f); - } - break; case OP_TAP_TOGGLE: /* tap toggle */ if (event.pressed) { @@ -652,6 +651,7 @@ void process_action(keyrecord_t *record, action_t action) // if this event is a layer action, update the leds switch (action.kind.id) { case ACT_LAYER: + case ACT_LAYER_MODS: #ifndef NO_ACTION_TAPPING case ACT_LAYER_TAP: case ACT_LAYER_TAP_EXT: @@ -957,7 +957,7 @@ bool is_tap_action(action_t action) case ACT_LAYER_TAP: case ACT_LAYER_TAP_EXT: switch (action.layer_tap.code) { - case 0x00 ... 0xdf: + case KC_NO ... KC_RGUI: case OP_TAP_TOGGLE: case OP_ONESHOT: return true; @@ -965,7 +965,7 @@ bool is_tap_action(action_t action) return false; case ACT_SWAP_HANDS: switch (action.swap.code) { - case 0x00 ... 0xdf: + case KC_NO ... KC_RGUI: case OP_SH_TAP_TOGGLE: return true; } @@ -1014,6 +1014,7 @@ void debug_action(action_t action) case ACT_USAGE: dprint("ACT_USAGE"); break; case ACT_MOUSEKEY: dprint("ACT_MOUSEKEY"); break; case ACT_LAYER: dprint("ACT_LAYER"); break; + case ACT_LAYER_MODS: dprint("ACT_LAYER_MODS"); break; case ACT_LAYER_TAP: dprint("ACT_LAYER_TAP"); break; case ACT_LAYER_TAP_EXT: dprint("ACT_LAYER_TAP_EXT"); break; case ACT_MACRO: dprint("ACT_MACRO"); break; |