aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Macros.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Macros.cpp b/src/Macros.cpp
index 2fd4229..c8013cc 100644
--- a/src/Macros.cpp
+++ b/src/Macros.cpp
@@ -24,15 +24,20 @@
* like i3: without this macro it doesn't see the difference between
* $mod+R0C2 (switch to workspace #2) and $mod+shift+R0C2 (move focused
* container to workspace #2), as R0C2 triggers LSHIFT(Key_2).
+ *
+ * XXX doesn't work with repeats...
+ * https://github.com/keyboardio/Kaleidoscope/issues/647
*/
#define TopRow(k1, k2) \
- if (kaleidoscope::hid::isModifierKeyActive(Key_LeftControl) || \
- ::OneShot.isModifierActive(Key_LeftControl) || \
- kaleidoscope::hid::isModifierKeyActive(Key_RightAlt) || \
- ::OneShot.isModifierActive(Key_RightAlt)) \
- return MACRODOWN(Tr(k2)); \
- else \
- return MACRODOWN(Tr(k1)); \
+ if (keyToggledOn(keyState)) { \
+ if (kaleidoscope::hid::isModifierKeyActive(Key_LeftControl) || \
+ ::OneShot.isModifierActive(Key_LeftControl) || \
+ kaleidoscope::hid::isModifierKeyActive(Key_RightAlt) || \
+ ::OneShot.isModifierActive(Key_RightAlt)) \
+ return MACRO(Dr(k2)); \
+ else \
+ return MACRO(Dr(k1)); \
+ };
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
switch (macroIndex) {