aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2019-08-08 10:21:52 +0200
committerGuilhem Moulin <guilhem@fripost.org>2019-08-08 10:22:03 +0200
commit62f423083131586749b3246ac81f2b511db87bf5 (patch)
tree6d2c2ac2eb41356147c7e4d11b0eee6a7dfe1255 /src
parentd5f328d5b8145c0a2c208d89a3ef40178da3c219 (diff)
Refactor TopRow() macro.
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) {