aboutsummaryrefslogtreecommitdiffstats
path: root/src/Macros.cpp
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2022-04-08 12:09:58 +0200
committerGuilhem Moulin <guilhem@fripost.org>2022-08-29 17:21:03 +0200
commit5199c41cfd20d1f986fa1ebba3adf824991323ae (patch)
treef7a18bce2a81dbfeb53d301ecaecbd6e93c1c922 /src/Macros.cpp
parent349615d851293423e46259ecc7b495513cbdd286 (diff)
Fix build with AVR 1.85 and keyboardio a916561.HEADmaster
And arduino-mk=1.5.2-2.1, gcc-avr=1:5.4.0+Atmel3.6.2-3, avr-libc=1:2.0.0+Atmel3.6.2-3.
Diffstat (limited to 'src/Macros.cpp')
-rw-r--r--src/Macros.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Macros.cpp b/src/Macros.cpp
index e1c567a..529bfca 100644
--- a/src/Macros.cpp
+++ b/src/Macros.cpp
@@ -30,18 +30,16 @@
* https://github.com/keyboardio/Kaleidoscope/issues/647
*/
#define TopRow(k1, k2) \
- if (keyToggledOn(keyState)) { \
- if (Kaleidoscope.hid().keyboard().isModifierKeyActive(Key_LeftControl) || \
- OneShot.isModifierActive(Key_LeftControl) || \
- Kaleidoscope.hid().keyboard().isModifierKeyActive(Key_RightAlt) || \
- OneShot.isModifierActive(Key_RightAlt)) \
+ if (keyToggledOn(event.state)) { \
+ if (Kaleidoscope.hid().keyboard().wasModifierKeyActive(Key_LeftControl) || \
+ Kaleidoscope.hid().keyboard().wasModifierKeyActive(Key_RightAlt)) \
return MACRO(Dr(k2)); \
else \
return MACRO(Dr(k1)); \
};
-const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
- switch (macroIndex) {
+const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
+ switch (macro_id) {
case AT: TopRow(LSHIFT(Key_2), Key_2);
case STAR: TopRow(LSHIFT(Key_8), Key_3);
case DOLLAR: TopRow(LSHIFT(Key_4), Key_4);