diff --git a/src/Keyboardio-Macros.cpp b/src/Keyboardio-Macros.cpp index bd4b4e4e..eb408576 100644 --- a/src/Keyboardio-Macros.cpp +++ b/src/Keyboardio-Macros.cpp @@ -5,6 +5,8 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { return MACRO_NONE; } +byte Macros_::row, Macros_::col; + void Macros_::play(const macro_t *macro_p) { macro_t macro = END; uint8_t interval = 0; @@ -51,6 +53,8 @@ static Key handleMacroEvent(Key mappedKey, byte row, byte col, uint8_t keyState) if (!key_toggled_on(keyState)) return Key_NoKey; + Macros_::row = row; + Macros_::col = col; const macro_t *m = macroAction(mappedKey.keyCode, keyState); Macros.play(m); diff --git a/src/Keyboardio-Macros.h b/src/Keyboardio-Macros.h index 172de9d7..e5e8b723 100644 --- a/src/Keyboardio-Macros.h +++ b/src/Keyboardio-Macros.h @@ -14,6 +14,8 @@ class Macros_ : public KeyboardioPlugin { virtual void begin(void) final; void play(const macro_t *macro_p); + + static byte row, col; }; extern Macros_ Macros;