]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Prevent the recording of looping dynamic macros.
authorDaniel Shields <dshields@bats.com>
Thu, 11 May 2017 08:46:11 +0000 (09:46 +0100)
committerDaniel Shields <dshields@bats.com>
Thu, 1 Jun 2017 15:29:58 +0000 (16:29 +0100)
If a macro play key is inadvertently recorded in a dynamic macro
a loop is created and the macro will not terminate when played.

This should be prevented.

quantum/dynamic_macro.h

index f242405defbdcd7416371c87be7271a1a96e19b3..045ee95b5f170d5902157554ff73dbfdec04ebaa 100644 (file)
@@ -274,6 +274,10 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
                 macro_id = 0;
             }
             return false;
+        case DYN_MACRO_PLAY1:
+        case DYN_MACRO_PLAY2:
+            dprintln("dynamic macro: ignoring macro play key while recording");
+            return false;
         default:
             /* Store the key in the macro buffer and process it normally. */
             switch (macro_id) {