aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md51
1 files changed, 49 insertions, 2 deletions
diff --git a/readme.md b/readme.md
index e2221e749..37f140839 100644
--- a/readme.md
+++ b/readme.md
@@ -431,7 +431,7 @@ enum {
431}; 431};
432 432
433//Tap Dance Definitions 433//Tap Dance Definitions
434const qk_tap_dance_action_t tap_dance_actions[] = { 434qk_tap_dance_action_t tap_dance_actions[] = {
435 //Tap once for Esc, twice for Caps Lock 435 //Tap once for Esc, twice for Caps Lock
436 [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) 436 [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS)
437// Other declarations would go here, separated by commas, if you have them 437// Other declarations would go here, separated by commas, if you have them
@@ -517,7 +517,7 @@ void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
517 ergodox_right_led_3_off(); 517 ergodox_right_led_3_off();
518} 518}
519 519
520const qk_tap_dance_action_t tap_dance_actions[] = { 520qk_tap_dance_action_t tap_dance_actions[] = {
521 [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) 521 [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT)
522 ,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset) 522 ,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
523 ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) 523 ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg)
@@ -695,6 +695,53 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
695 695
696And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for copy/paste. 696And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for copy/paste.
697 697
698## Dynamic macros: record and replay macros in runtime
699
700In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 128 keypresses.
701
702To enable them, first add a new element to the `planck_keycodes` enum -- `DYNAMIC_MACRO_RANGE`:
703
704 enum planck_keycodes {
705 QWERTY = SAFE_RANGE,
706 COLEMAK,
707 DVORAK,
708 PLOVER,
709 LOWER,
710 RAISE,
711 BACKLIT,
712 EXT_PLV,
713 DYNAMIC_MACRO_RANGE,
714 };
715
716Afterwards create a new layer called `_DYN`:
717
718 #define _DYN 6 /* almost any other free number should be ok */
719
720Below these two modifications include the `dynamic_macro.h` header:
721
722 #include "dynamic_macro.h"`
723
724Then define the `_DYN` layer with the following keys: `DYN_REC_START1`, `DYN_MACRO_PLAY1`,`DYN_REC_START2` and `DYN_MACRO_PLAY2`. It may also contain other keys, it doesn't matter apart from the fact that you won't be able to record these keys in the dynamic macros.
725
726 [_DYN]= {
727 {_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, _______, _______, _______, _______, _______},
728 {_______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, _______, _______, _______},
729 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
730 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
731 },
732
733Add the following code to the very beginning of your `process_record_user()` function:
734
735 if (!process_record_dynamic_macro(keycode, record)) {
736 return false;
737 }
738
739To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `_DYN` layer button. The handler awaits specifically for the `MO(_DYN)` keycode as the "stop signal" so please don't use any fancy ways to access this layer, use the regular `MO()` modifier. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
740
741If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 256; please read the comments for it in the header).
742
743For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
744
698## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) 745## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc)
699 746
700Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: 747Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: