diff options
-rw-r--r-- | Makefile | 27 | ||||
-rw-r--r-- | src/Macros.cpp | 12 | ||||
-rw-r--r-- | src/Macros.h | 2 |
3 files changed, 28 insertions, 13 deletions
@@ -16,14 +16,31 @@ LOCAL_CPP_SRCS = $(wildcard $(SOURCEDIR)/*.cpp) LOCAL_INO_SRCS = $(wildcard $(SOURCEDIR)/*.ino) USER_LIB_PATH = $(ALTERNATE_CORE_PATH)/libraries -KALEIDOSCOPE_PLUGINS = $(notdir $(wildcard $(USER_LIB_PATH)/Kaleidoscope/plugins/Kaleidoscope-*)) -ARDUINO_LIBS = EEPROM Kaleidoscope KeyboardioHID KeyboardioScanner \ - $(addprefix Kaleidoscope/plugins/,$(KALEIDOSCOPE_PLUGINS)) - -# extra definitions from boards.txt +KALEIDOSCOPE_PLUGINS = Kaleidoscope-Colormap \ + Kaleidoscope-EEPROM-Settings \ + Kaleidoscope-Escape-OneShot \ + Kaleidoscope-FocusSerial \ + Kaleidoscope-Hardware-Model01 \ + Kaleidoscope-Hardware-Keyboardio-Model01 \ + Kaleidoscope-IdleLEDs \ + Kaleidoscope-LED-ActiveModColor \ + Kaleidoscope-LED-Palette-Theme \ + Kaleidoscope-Macros \ + Kaleidoscope-MagicCombo \ + Kaleidoscope-MouseKeys \ + Kaleidoscope-OneShot \ + Kaleidoscope-OneShotMetaKeys \ + Kaleidoscope-Ranges \ + Kaleidoscope-TapDance +ARDUINO_LIBS = EEPROM Kaleidoscope KeyboardioHID \ + $(addprefix Kaleidoscope/plugins/,$(KALEIDOSCOPE_PLUGINS)) + +# extra definitions from lib/hardware/keyboardio/avr/boards.txt CXXFLAGS = -DARDUINO_AVR_MODEL01 \ -DUSB_MANUFACTURER="\"keyboardio\"" -DUSB_PRODUCT="\"Model 01\"" \ -DKALEIDOSCOPE_HARDWARE_H="\"Kaleidoscope-Hardware-Model01.h\"" +# cf. lib/hardware/keyboardio/avr/platform.txt +CXXFLAGS_STD = -std=c++14 -fno-threadsafe-statics ifeq ($(ENABLE_SERIAL),yes) CXXFLAGS += -DENABLE_SERIAL 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); diff --git a/src/Macros.h b/src/Macros.h index 829308c..5e4395c 100644 --- a/src/Macros.h +++ b/src/Macros.h @@ -34,4 +34,4 @@ enum { , RIGHT_BRACKET }; -extern const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState); +extern const macro_t *macroAction(uint8_t macro_id, KeyEvent &event); |