2 Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "action_layer.h"
24 #include "action_tapping.h"
25 #include "action_macro.h"
26 #include "action_util.h"
30 #ifdef BACKLIGHT_ENABLE
31 # include "backlight.h"
43 int retro_tapping_counter
= 0;
46 #ifdef FAUXCLICKY_ENABLE
47 # include <fauxclicky.h>
50 #ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
51 __attribute__((weak
)) bool get_ignore_mod_tap_interrupt(uint16_t keycode
) { return false; }
54 #ifndef TAP_CODE_DELAY
55 # define TAP_CODE_DELAY 0
57 #ifndef TAP_HOLD_CAPS_DELAY
58 # define TAP_HOLD_CAPS_DELAY 80
60 /** \brief Called to execute an action.
62 * FIXME: Needs documentation.
64 void action_exec(keyevent_t event
) {
65 if (!IS_NOEVENT(event
)) {
66 dprint("\n---- action_exec: start -----\n");
71 retro_tapping_counter
++;
75 #ifdef FAUXCLICKY_ENABLE
76 if (IS_PRESSED(event
)) {
77 FAUXCLICKY_ACTION_PRESS
;
79 if (IS_RELEASED(event
)) {
80 FAUXCLICKY_ACTION_RELEASE
;
85 #ifdef SWAP_HANDS_ENABLE
86 if (!IS_NOEVENT(event
)) {
87 process_hand_swap(&event
);
91 keyrecord_t record
= {.event
= event
};
93 #ifndef NO_ACTION_ONESHOT
94 # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
95 if (has_oneshot_layer_timed_out()) {
96 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED
);
98 if (has_oneshot_mods_timed_out()) {
104 #ifndef NO_ACTION_TAPPING
105 action_tapping_process(record
);
107 process_record(&record
);
108 if (!IS_NOEVENT(record
.event
)) {
109 dprint("processed: ");
110 debug_record(record
);
116 #ifdef SWAP_HANDS_ENABLE
117 bool swap_hands
= false;
118 bool swap_held
= false;
120 /** \brief Process Hand Swap
122 * FIXME: Needs documentation.
124 void process_hand_swap(keyevent_t
*event
) {
125 static swap_state_row_t swap_state
[MATRIX_ROWS
];
127 keypos_t pos
= event
->key
;
128 swap_state_row_t col_bit
= (swap_state_row_t
)1 << pos
.col
;
129 bool do_swap
= event
->pressed
? swap_hands
: swap_state
[pos
.row
] & (col_bit
);
132 event
->key
= hand_swap_config
[pos
.row
][pos
.col
];
133 swap_state
[pos
.row
] |= col_bit
;
135 swap_state
[pos
.row
] &= ~(col_bit
);
140 #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
141 bool disable_action_cache
= false;
143 void process_record_nocache(keyrecord_t
*record
) {
144 disable_action_cache
= true;
145 process_record(record
);
146 disable_action_cache
= false;
149 void process_record_nocache(keyrecord_t
*record
) { process_record(record
); }
152 __attribute__((weak
)) bool process_record_quantum(keyrecord_t
*record
) { return true; }
154 #ifndef NO_ACTION_TAPPING
155 /** \brief Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress.
157 * FIXME: Needs documentation.
159 void process_record_tap_hint(keyrecord_t
*record
) {
160 action_t action
= layer_switch_get_action(record
->event
.key
);
162 switch (action
.kind
.id
) {
163 # ifdef SWAP_HANDS_ENABLE
165 switch (action
.swap
.code
) {
166 case OP_SH_TAP_TOGGLE
:
168 swap_hands
= !swap_hands
;
177 /** \brief Take a key event (key press or key release) and processes it.
179 * FIXME: Needs documentation.
181 void process_record(keyrecord_t
*record
) {
182 if (IS_NOEVENT(record
->event
)) {
186 if (!process_record_quantum(record
)) return;
188 action_t action
= store_or_get_action(record
->event
.pressed
, record
->event
.key
);
190 debug_action(action
);
191 #ifndef NO_ACTION_LAYER
192 dprint(" layer_state: ");
194 dprint(" default_layer_state: ");
195 default_layer_debug();
199 process_action(record
, action
);
202 /** \brief Take an action and processes it.
204 * FIXME: Needs documentation.
206 void process_action(keyrecord_t
*record
, action_t action
) {
207 keyevent_t event
= record
->event
;
208 #ifndef NO_ACTION_TAPPING
209 uint8_t tap_count
= record
->tap
.count
;
213 // clear the potential weak mods left by previously pressed keys
217 #ifndef NO_ACTION_ONESHOT
218 bool do_release_oneshot
= false;
219 // notice we only clear the one shot layer if the pressed key is not a modifier.
220 if (is_oneshot_layer_active() && event
.pressed
&& !IS_MOD(action
.key
.code
)) {
221 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED
);
222 do_release_oneshot
= !is_oneshot_layer_active();
226 switch (action
.kind
.id
) {
230 uint8_t mods
= (action
.kind
.id
== ACT_LMODS
) ? action
.key
.mods
: action
.key
.mods
<< 4;
233 if (IS_MOD(action
.key
.code
) || action
.key
.code
== KC_NO
) {
234 // e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless.
235 // This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT).
236 // Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
241 send_keyboard_report();
243 register_code(action
.key
.code
);
245 unregister_code(action
.key
.code
);
247 if (IS_MOD(action
.key
.code
) || action
.key
.code
== KC_NO
) {
252 send_keyboard_report();
256 #ifndef NO_ACTION_TAPPING
258 case ACT_RMODS_TAP
: {
259 uint8_t mods
= (action
.kind
.id
== ACT_LMODS_TAP
) ? action
.key
.mods
: action
.key
.mods
<< 4;
260 switch (action
.layer_tap
.code
) {
261 # ifndef NO_ACTION_ONESHOT
265 if (tap_count
== 0) {
266 dprint("MODS_TAP: Oneshot: 0\n");
267 register_mods(mods
| get_oneshot_mods());
268 } else if (tap_count
== 1) {
269 dprint("MODS_TAP: Oneshot: start\n");
270 set_oneshot_mods(mods
| get_oneshot_mods());
271 # if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1
272 } else if (tap_count
== ONESHOT_TAP_TOGGLE
) {
273 dprint("MODS_TAP: Toggling oneshot");
274 clear_oneshot_mods();
275 set_oneshot_locked_mods(mods
);
279 register_mods(mods
| get_oneshot_mods());
282 if (tap_count
== 0) {
283 clear_oneshot_mods();
284 unregister_mods(mods
);
285 } else if (tap_count
== 1) {
286 // Retain Oneshot mods
287 # if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1
288 if (mods
& get_mods()) {
289 clear_oneshot_locked_mods();
290 clear_oneshot_mods();
291 unregister_mods(mods
);
293 } else if (tap_count
== ONESHOT_TAP_TOGGLE
) {
294 // Toggle Oneshot Layer
297 clear_oneshot_mods();
298 unregister_mods(mods
);
303 case MODS_TAP_TOGGLE
:
305 if (tap_count
<= TAPPING_TOGGLE
) {
309 if (tap_count
< TAPPING_TOGGLE
) {
310 unregister_mods(mods
);
317 # if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY)
319 # ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
320 !get_ignore_mod_tap_interrupt(get_event_keycode(record
->event
)) &&
322 record
->tap
.interrupted
) {
323 dprint("mods_tap: tap: cancel: add_mods\n");
324 // ad hoc: set 0 to cancel tap
325 record
->tap
.count
= 0;
330 dprint("MODS_TAP: Tap: register_code\n");
331 register_code(action
.key
.code
);
334 dprint("MODS_TAP: No tap: add_mods\n");
339 dprint("MODS_TAP: Tap: unregister_code\n");
340 if (action
.layer_tap
.code
== KC_CAPS
) {
341 wait_ms(TAP_HOLD_CAPS_DELAY
);
343 unregister_code(action
.key
.code
);
345 dprint("MODS_TAP: No tap: add_mods\n");
346 unregister_mods(mods
);
353 #ifdef EXTRAKEY_ENABLE
354 /* other HID usage */
356 switch (action
.usage
.page
) {
359 host_system_send(action
.usage
.code
);
366 host_consumer_send(action
.usage
.code
);
368 host_consumer_send(0);
374 #ifdef MOUSEKEY_ENABLE
378 switch (action
.key
.code
) {
380 tp_buttons
|= (1 << 0);
383 tp_buttons
|= (1 << 1);
386 tp_buttons
|= (1 << 2);
391 mousekey_on(action
.key
.code
);
394 switch (action
.key
.code
) {
396 tp_buttons
&= ~(1 << 0);
399 tp_buttons
&= ~(1 << 1);
402 tp_buttons
&= ~(1 << 2);
407 mousekey_off(action
.key
.code
);
412 #ifndef NO_ACTION_LAYER
414 if (action
.layer_bitop
.on
== 0) {
415 /* Default Layer Bitwise Operation */
416 if (!event
.pressed
) {
417 uint8_t shift
= action
.layer_bitop
.part
* 4;
418 layer_state_t bits
= ((layer_state_t
)action
.layer_bitop
.bits
) << shift
;
419 layer_state_t mask
= (action
.layer_bitop
.xbit
) ? ~(((layer_state_t
)0xf) << shift
) : 0;
420 switch (action
.layer_bitop
.op
) {
422 default_layer_and(bits
| mask
);
425 default_layer_or(bits
| mask
);
428 default_layer_xor(bits
| mask
);
431 default_layer_set(bits
| mask
);
436 /* Layer Bitwise Operation */
437 if (event
.pressed
? (action
.layer_bitop
.on
& ON_PRESS
) : (action
.layer_bitop
.on
& ON_RELEASE
)) {
438 uint8_t shift
= action
.layer_bitop
.part
* 4;
439 layer_state_t bits
= ((layer_state_t
)action
.layer_bitop
.bits
) << shift
;
440 layer_state_t mask
= (action
.layer_bitop
.xbit
) ? ~(((layer_state_t
)0xf) << shift
) : 0;
441 switch (action
.layer_bitop
.op
) {
443 layer_and(bits
| mask
);
446 layer_or(bits
| mask
);
449 layer_xor(bits
| mask
);
452 layer_state_set(bits
| mask
);
460 layer_on(action
.layer_mods
.layer
);
461 register_mods(action
.layer_mods
.mods
);
463 unregister_mods(action
.layer_mods
.mods
);
464 layer_off(action
.layer_mods
.layer
);
467 # ifndef NO_ACTION_TAPPING
469 case ACT_LAYER_TAP_EXT
:
470 switch (action
.layer_tap
.code
) {
474 if (tap_count
< TAPPING_TOGGLE
) {
475 layer_invert(action
.layer_tap
.val
);
478 if (tap_count
<= TAPPING_TOGGLE
) {
479 layer_invert(action
.layer_tap
.val
);
484 event
.pressed
? layer_on(action
.layer_tap
.val
) : layer_off(action
.layer_tap
.val
);
487 event
.pressed
? layer_off(action
.layer_tap
.val
) : layer_on(action
.layer_tap
.val
);
490 event
.pressed
? layer_move(action
.layer_tap
.val
) : layer_clear();
492 # ifndef NO_ACTION_ONESHOT
495 # if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1
496 do_release_oneshot
= false;
498 del_mods(get_oneshot_locked_mods());
499 if (get_oneshot_layer_state() == ONESHOT_TOGGLED
) {
500 reset_oneshot_layer();
501 layer_off(action
.layer_tap
.val
);
503 } else if (tap_count
< ONESHOT_TAP_TOGGLE
) {
504 layer_on(action
.layer_tap
.val
);
505 set_oneshot_layer(action
.layer_tap
.val
, ONESHOT_START
);
508 add_mods(get_oneshot_locked_mods());
509 if (tap_count
>= ONESHOT_TAP_TOGGLE
) {
510 reset_oneshot_layer();
511 clear_oneshot_locked_mods();
512 set_oneshot_layer(action
.layer_tap
.val
, ONESHOT_TOGGLED
);
514 clear_oneshot_layer_state(ONESHOT_PRESSED
);
519 layer_on(action
.layer_tap
.val
);
520 set_oneshot_layer(action
.layer_tap
.val
, ONESHOT_START
);
522 clear_oneshot_layer_state(ONESHOT_PRESSED
);
524 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED
);
534 dprint("KEYMAP_TAP_KEY: Tap: register_code\n");
535 register_code(action
.layer_tap
.code
);
537 dprint("KEYMAP_TAP_KEY: No tap: On on press\n");
538 layer_on(action
.layer_tap
.val
);
542 dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n");
543 if (action
.layer_tap
.code
== KC_CAPS
) {
544 wait_ms(TAP_HOLD_CAPS_DELAY
);
546 wait_ms(TAP_CODE_DELAY
);
548 unregister_code(action
.layer_tap
.code
);
550 dprint("KEYMAP_TAP_KEY: No tap: Off on release\n");
551 layer_off(action
.layer_tap
.val
);
560 #ifndef NO_ACTION_MACRO
562 action_macro_play(action_get_macro(record
, action
.func
.id
, action
.func
.opt
));
567 #ifdef SWAP_HANDS_ENABLE
569 switch (action
.swap
.code
) {
572 swap_hands
= !swap_hands
;
576 swap_hands
= event
.pressed
;
579 swap_hands
= !event
.pressed
;
582 if (!event
.pressed
) {
587 if (!event
.pressed
) {
591 # ifndef NO_ACTION_TAPPING
592 case OP_SH_TAP_TOGGLE
:
599 swap_hands
= !swap_hands
;
602 if (tap_count
< TAPPING_TOGGLE
) {
603 swap_hands
= !swap_hands
;
611 swap_hands
= !swap_hands
; // undo hold set up in _tap_hint
615 register_code(action
.swap
.code
);
617 wait_ms(TAP_CODE_DELAY
);
618 unregister_code(action
.swap
.code
);
619 *record
= (keyrecord_t
){}; // hack: reset tap mode
622 if (swap_held
&& !event
.pressed
) {
623 swap_hands
= !swap_hands
; // undo hold set up in _tap_hint
630 #ifndef NO_ACTION_FUNCTION
632 action_function(record
, action
.func
.id
, action
.func
.opt
);
639 #ifndef NO_ACTION_LAYER
640 // if this event is a layer action, update the leds
641 switch (action
.kind
.id
) {
644 # ifndef NO_ACTION_TAPPING
646 case ACT_LAYER_TAP_EXT
:
648 led_set(host_keyboard_leds());
655 #ifndef NO_ACTION_TAPPING
656 # ifdef RETRO_TAPPING
657 if (!is_tap_action(action
)) {
658 retro_tapping_counter
= 0;
662 retro_tapping_counter
= 0;
667 retro_tapping_counter
= 0;
669 if (retro_tapping_counter
== 2) {
670 tap_code(action
.layer_tap
.code
);
672 retro_tapping_counter
= 0;
679 #ifndef NO_ACTION_ONESHOT
680 /* Because we switch layers after a oneshot event, we need to release the
681 * key before we leave the layer or no key up event will be generated.
683 if (do_release_oneshot
&& !(get_oneshot_layer_state() & ONESHOT_PRESSED
)) {
684 record
->event
.pressed
= false;
685 layer_on(get_oneshot_layer());
686 process_record(record
);
687 layer_off(get_oneshot_layer());
692 /** \brief Utilities for actions. (FIXME: Needs better description)
694 * FIXME: Needs documentation.
696 void register_code(uint8_t code
) {
700 #ifdef LOCKING_SUPPORT_ENABLE
701 else if (KC_LOCKING_CAPS
== code
) {
702 # ifdef LOCKING_RESYNC_ENABLE
703 // Resync: ignore if caps lock already is on
704 if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK
)) return;
706 add_key(KC_CAPSLOCK
);
707 send_keyboard_report();
709 del_key(KC_CAPSLOCK
);
710 send_keyboard_report();
713 else if (KC_LOCKING_NUM
== code
) {
714 # ifdef LOCKING_RESYNC_ENABLE
715 if (host_keyboard_leds() & (1 << USB_LED_NUM_LOCK
)) return;
718 send_keyboard_report();
721 send_keyboard_report();
724 else if (KC_LOCKING_SCROLL
== code
) {
725 # ifdef LOCKING_RESYNC_ENABLE
726 if (host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK
)) return;
728 add_key(KC_SCROLLLOCK
);
729 send_keyboard_report();
731 del_key(KC_SCROLLLOCK
);
732 send_keyboard_report();
738 // TODO: should push command_proc out of this block?
739 if (command_proc(code
)) return;
741 #ifndef NO_ACTION_ONESHOT
743 if (oneshot_state.mods && !oneshot_state.disabled) {
744 uint8_t tmp_mods = get_mods();
745 add_mods(oneshot_state.mods);
748 send_keyboard_report();
751 send_keyboard_report();
758 send_keyboard_report();
763 add_mods(MOD_BIT(code
));
764 send_keyboard_report();
767 IS_SYSTEM(code
) { host_system_send(KEYCODE2SYSTEM(code
)); }
769 IS_CONSUMER(code
) { host_consumer_send(KEYCODE2CONSUMER(code
)); }
771 #ifdef MOUSEKEY_ENABLE
780 /** \brief Utilities for actions. (FIXME: Needs better description)
782 * FIXME: Needs documentation.
784 void unregister_code(uint8_t code
) {
788 #ifdef LOCKING_SUPPORT_ENABLE
789 else if (KC_LOCKING_CAPS
== code
) {
790 # ifdef LOCKING_RESYNC_ENABLE
791 // Resync: ignore if caps lock already is off
792 if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK
))) return;
794 add_key(KC_CAPSLOCK
);
795 send_keyboard_report();
796 del_key(KC_CAPSLOCK
);
797 send_keyboard_report();
800 else if (KC_LOCKING_NUM
== code
) {
801 # ifdef LOCKING_RESYNC_ENABLE
802 if (!(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK
))) return;
805 send_keyboard_report();
807 send_keyboard_report();
810 else if (KC_LOCKING_SCROLL
== code
) {
811 # ifdef LOCKING_RESYNC_ENABLE
812 if (!(host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK
))) return;
814 add_key(KC_SCROLLLOCK
);
815 send_keyboard_report();
816 del_key(KC_SCROLLLOCK
);
817 send_keyboard_report();
824 send_keyboard_report();
828 del_mods(MOD_BIT(code
));
829 send_keyboard_report();
832 IS_SYSTEM(code
) { host_system_send(0); }
834 IS_CONSUMER(code
) { host_consumer_send(0); }
835 #ifdef MOUSEKEY_ENABLE
844 /** \brief Utilities for actions. (FIXME: Needs better description)
846 * FIXME: Needs documentation.
848 void tap_code(uint8_t code
) {
850 if (code
== KC_CAPS
) {
851 wait_ms(TAP_HOLD_CAPS_DELAY
);
853 wait_ms(TAP_CODE_DELAY
);
855 unregister_code(code
);
858 /** \brief Adds the given physically pressed modifiers and sends a keyboard report immediately.
860 * \param mods A bitfield of modifiers to unregister.
862 void register_mods(uint8_t mods
) {
865 send_keyboard_report();
869 /** \brief Removes the given physically pressed modifiers and sends a keyboard report immediately.
871 * \param mods A bitfield of modifiers to unregister.
873 void unregister_mods(uint8_t mods
) {
876 send_keyboard_report();
880 /** \brief Adds the given weak modifiers and sends a keyboard report immediately.
882 * \param mods A bitfield of modifiers to register.
884 void register_weak_mods(uint8_t mods
) {
887 send_keyboard_report();
891 /** \brief Removes the given weak modifiers and sends a keyboard report immediately.
893 * \param mods A bitfield of modifiers to unregister.
895 void unregister_weak_mods(uint8_t mods
) {
898 send_keyboard_report();
902 /** \brief Utilities for actions. (FIXME: Needs better description)
904 * FIXME: Needs documentation.
906 void clear_keyboard(void) {
908 clear_keyboard_but_mods();
911 /** \brief Utilities for actions. (FIXME: Needs better description)
913 * FIXME: Needs documentation.
915 void clear_keyboard_but_mods(void) {
917 clear_keyboard_but_mods_and_keys();
920 /** \brief Utilities for actions. (FIXME: Needs better description)
922 * FIXME: Needs documentation.
924 void clear_keyboard_but_mods_and_keys() {
927 send_keyboard_report();
928 #ifdef MOUSEKEY_ENABLE
932 #ifdef EXTRAKEY_ENABLE
934 host_consumer_send(0);
938 /** \brief Utilities for actions. (FIXME: Needs better description)
940 * FIXME: Needs documentation.
942 bool is_tap_key(keypos_t key
) {
943 action_t action
= layer_switch_get_action(key
);
944 return is_tap_action(action
);
947 /** \brief Utilities for actions. (FIXME: Needs better description)
949 * FIXME: Needs documentation.
951 bool is_tap_action(action_t action
) {
952 switch (action
.kind
.id
) {
956 case ACT_LAYER_TAP_EXT
:
957 switch (action
.layer_tap
.code
) {
958 case KC_NO
... KC_RGUI
:
965 switch (action
.swap
.code
) {
966 case KC_NO
... KC_RGUI
:
967 case OP_SH_TAP_TOGGLE
:
973 if (action
.func
.opt
& FUNC_TAP
) {
981 /** \brief Debug print (FIXME: Needs better description)
983 * FIXME: Needs documentation.
985 void debug_event(keyevent_t event
) { dprintf("%04X%c(%u)", (event
.key
.row
<< 8 | event
.key
.col
), (event
.pressed
? 'd' : 'u'), event
.time
); }
987 /** \brief Debug print (FIXME: Needs better description)
989 * FIXME: Needs documentation.
991 void debug_record(keyrecord_t record
) {
992 debug_event(record
.event
);
993 #ifndef NO_ACTION_TAPPING
994 dprintf(":%u%c", record
.tap
.count
, (record
.tap
.interrupted
? '-' : ' '));
998 /** \brief Debug print (FIXME: Needs better description)
1000 * FIXME: Needs documentation.
1002 void debug_action(action_t action
) {
1003 switch (action
.kind
.id
) {
1005 dprint("ACT_LMODS");
1008 dprint("ACT_RMODS");
1011 dprint("ACT_LMODS_TAP");
1014 dprint("ACT_RMODS_TAP");
1017 dprint("ACT_USAGE");
1020 dprint("ACT_MOUSEKEY");
1023 dprint("ACT_LAYER");
1025 case ACT_LAYER_MODS
:
1026 dprint("ACT_LAYER_MODS");
1029 dprint("ACT_LAYER_TAP");
1031 case ACT_LAYER_TAP_EXT
:
1032 dprint("ACT_LAYER_TAP_EXT");
1035 dprint("ACT_MACRO");
1038 dprint("ACT_COMMAND");
1041 dprint("ACT_FUNCTION");
1043 case ACT_SWAP_HANDS
:
1044 dprint("ACT_SWAP_HANDS");
1050 dprintf("[%X:%02X]", action
.kind
.param
>> 8, action
.kind
.param
& 0xff);