diff --git a/examples/LED-ActiveModColor/LED-ActiveModColor.ino b/examples/LED-ActiveModColor/LED-ActiveModColor.ino index 384279f9..bd8f86b1 100644 --- a/examples/LED-ActiveModColor/LED-ActiveModColor.ino +++ b/examples/LED-ActiveModColor/LED-ActiveModColor.ino @@ -20,33 +20,33 @@ #include const Key keymaps[][ROWS][COLS] PROGMEM = { - [0] = KEYMAP_STACKED - ( - Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext, - Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, - Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, - Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape, - - Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, - Key_skip, - - Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, - Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, - Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, - Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, - - Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, - Key_skip - ), + [0] = KEYMAP_STACKED + ( + Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext, + Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, + Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, + Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape, + + Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, + Key_skip, + + Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, + Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, + Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, + Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, + + Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, + Key_skip + ), }; -void setup () { - Kaleidoscope.setup (KEYMAP_SIZE); - Kaleidoscope.use (&LEDControl, &ActiveModColorEffect, NULL); +void setup() { + Kaleidoscope.setup(KEYMAP_SIZE); + Kaleidoscope.use(&LEDControl, &ActiveModColorEffect, NULL); - ActiveModColorEffect.configure ({0x00, 0xff, 0xff}); + ActiveModColorEffect.configure({0x00, 0xff, 0xff}); } -void loop () { - Kaleidoscope.loop (); +void loop() { + Kaleidoscope.loop(); } diff --git a/src/Kaleidoscope/LED-ActiveModColor.cpp b/src/Kaleidoscope/LED-ActiveModColor.cpp index d9d0d77b..24a8d0c8 100644 --- a/src/Kaleidoscope/LED-ActiveModColor.cpp +++ b/src/Kaleidoscope/LED-ActiveModColor.cpp @@ -22,44 +22,44 @@ namespace KaleidoscopePlugins { namespace LEDEffects { cRGB ActiveModColorEffect::highlightColor = (cRGB) { - 0xff, 0xff, 0xff + 0xff, 0xff, 0xff }; -ActiveModColorEffect::ActiveModColorEffect (void) { +ActiveModColorEffect::ActiveModColorEffect(void) { } void -ActiveModColorEffect::begin (void) { - loop_hook_use (loopHook); +ActiveModColorEffect::begin(void) { + loop_hook_use(loopHook); } void -ActiveModColorEffect::configure (const cRGB highlightColor_) { - highlightColor = highlightColor_; +ActiveModColorEffect::configure(const cRGB highlightColor_) { + highlightColor = highlightColor_; } void -ActiveModColorEffect::loopHook (bool postClear) { - if (postClear) - return; +ActiveModColorEffect::loopHook(bool postClear) { + if (postClear) + return; - for (byte r = 0; r < ROWS; r++) { - for (byte c = 0; c < COLS; c++) { - Key k = Layer.lookup (r, c); + for (byte r = 0; r < ROWS; r++) { + for (byte c = 0; c < COLS; c++) { + Key k = Layer.lookup(r, c); - if (k.raw >= KaleidoscopePlugins::Ranges::OSM_FIRST && k.raw <= KaleidoscopePlugins::Ranges::OSM_LAST) { - uint8_t idx = k.raw - KaleidoscopePlugins::Ranges::OSM_FIRST; - k.flags = 0; - k.keyCode = Key_LeftControl.keyCode + idx; - } + if (k.raw >= KaleidoscopePlugins::Ranges::OSM_FIRST && k.raw <= KaleidoscopePlugins::Ranges::OSM_LAST) { + uint8_t idx = k.raw - KaleidoscopePlugins::Ranges::OSM_FIRST; + k.flags = 0; + k.keyCode = Key_LeftControl.keyCode + idx; + } - if (k.raw < Key_LeftControl.raw || k.raw > Key_RightGui.raw) - continue; + if (k.raw < Key_LeftControl.raw || k.raw > Key_RightGui.raw) + continue; - if (Keyboard.isModifierActive (k.keyCode)) - LEDControl.led_set_crgb_at (r, c, highlightColor); - } + if (Keyboard.isModifierActive(k.keyCode)) + LEDControl.led_set_crgb_at(r, c, highlightColor); } + } } }; diff --git a/src/Kaleidoscope/LED-ActiveModColor.h b/src/Kaleidoscope/LED-ActiveModColor.h index fca1f9c1..96d0716b 100644 --- a/src/Kaleidoscope/LED-ActiveModColor.h +++ b/src/Kaleidoscope/LED-ActiveModColor.h @@ -22,15 +22,15 @@ namespace KaleidoscopePlugins { namespace LEDEffects { class ActiveModColorEffect : public KaleidoscopePlugin { - public: - ActiveModColorEffect (void); + public: + ActiveModColorEffect(void); - static void configure (const cRGB highlightColor); - virtual void begin (void) final; + static void configure(const cRGB highlightColor); + virtual void begin(void) final; - private: - static cRGB highlightColor; - static void loopHook (bool postClear); + private: + static cRGB highlightColor; + static void loopHook(bool postClear); }; }; };