diff --git a/examples/AppSwitcher/AppSwitcher.ino b/examples/AppSwitcher/AppSwitcher.ino index 03933667..fc01408e 100644 --- a/examples/AppSwitcher/AppSwitcher.ino +++ b/examples/AppSwitcher/AppSwitcher.ino @@ -64,5 +64,6 @@ void setup() { } void loop() { + macroAppSwitchLoop(); Kaleidoscope.loop(); } diff --git a/examples/AppSwitcher/Macros.cpp b/examples/AppSwitcher/Macros.cpp index 8055a3d7..af9bdba4 100644 --- a/examples/AppSwitcher/Macros.cpp +++ b/examples/AppSwitcher/Macros.cpp @@ -41,11 +41,6 @@ const macro_t *macroAppSwitch(uint8_t keyState) { if (keyToggledOff(keyState)) { return MACRO(U(Tab), Dr(mod)); } - // Key is not pressed, and was not just released. - // if appSwitchActive is true, we continue holding Alt. - if (appSwitchActive) { - return MACRO(Dr(mod)); - } // otherwise we do nothing return MACRO_NONE; } @@ -55,3 +50,15 @@ const macro_t *macroAppCancel(uint8_t keyState) { appSwitchActive = false; return MACRO_NONE; } + +void macroAppSwitchLoop() { + Key mod = Key_LeftAlt; + + if (HostOS.os() == H::OSX) + mod = Key_LeftGui; + + // if appSwitchActive is true, we continue holding Alt. + if (appSwitchActive) { + handleKeyswitchEvent(mod, UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED); + } +} diff --git a/examples/AppSwitcher/Macros.h b/examples/AppSwitcher/Macros.h index f6f6f581..91207e0a 100644 --- a/examples/AppSwitcher/Macros.h +++ b/examples/AppSwitcher/Macros.h @@ -28,3 +28,4 @@ enum { const macro_t *macroAppSwitch(uint8_t keyState); const macro_t *macroAppCancel(uint8_t keyState); +void macroAppSwitchLoop(); diff --git a/examples/Kaleidoscope/Kaleidoscope.ino b/examples/Kaleidoscope/Kaleidoscope.ino index af75e5fd..f94593a5 100644 --- a/examples/Kaleidoscope/Kaleidoscope.ino +++ b/examples/Kaleidoscope/Kaleidoscope.ino @@ -7,7 +7,7 @@ #include "Kaleidoscope-MouseKeys.h" #include "Kaleidoscope-Macros.h" #include "Kaleidoscope-LEDControl.h" -#include "Kaleidoscope-Numlock.h" +#include "Kaleidoscope-NumPad.h" #include "Kaleidoscope.h" #include "LED-Off.h" @@ -87,14 +87,14 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { KALEIDOSCOPE_INIT_PLUGINS(TestMode, LEDControl, LEDOff, solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, - LEDBreatheEffect, LEDRainbowEffect, LEDChaseEffect, NumLock, + LEDBreatheEffect, LEDRainbowEffect, LEDChaseEffect, NumPad, Macros, MouseKeys); void setup() { Kaleidoscope.setup(); - NumLock.numPadLayer = NUMPAD_KEYMAP; + NumPad.numPadLayer = NUMPAD_KEYMAP; LEDOff.activate(); }