From 897349b836bcc3b583306dae02631cc1c4a6f5ff Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 24 Dec 2016 00:12:19 +0100 Subject: [PATCH] Macros: Be a bit less eager The macro handler should only catch things that were meant to be its stuff, and should only act on keypress, not all kinds of key events. Signed-off-by: Gergely Nagy --- libraries/Keyboardio-Macros/src/Keyboardio-Macros.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/Keyboardio-Macros/src/Keyboardio-Macros.cpp b/libraries/Keyboardio-Macros/src/Keyboardio-Macros.cpp index 5089d7ef..15cadd54 100644 --- a/libraries/Keyboardio-Macros/src/Keyboardio-Macros.cpp +++ b/libraries/Keyboardio-Macros/src/Keyboardio-Macros.cpp @@ -45,9 +45,12 @@ void Macros_::play(const macro_t *macro_p) { } static bool handleMacroEvent(Key mappedKey, byte row, byte col, uint8_t keyState) { - if (!(mappedKey.flags & (SYNTHETIC|IS_MACRO)) || (mappedKey.flags & IS_INTERNAL)) + if (mappedKey.flags != (SYNTHETIC | IS_MACRO)) return false; + if (!key_toggled_on(keyState)) + return true; + const macro_t *m = macroAction(mappedKey.rawKey, keyState); Macros.play(m);