From e2d8866392cc020585fe77f2f584bc86e4cd2ff4 Mon Sep 17 00:00:00 2001 From: Nate Soares Date: Tue, 9 Jan 2018 06:11:50 -0800 Subject: [PATCH] added Key_LEDEffectPrevious --- src/Kaleidoscope-LEDControl.cpp | 8 ++++++-- src/Kaleidoscope-LEDControl.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Kaleidoscope-LEDControl.cpp b/src/Kaleidoscope-LEDControl.cpp index 21cbfca6..b7855c57 100644 --- a/src/Kaleidoscope-LEDControl.cpp +++ b/src/Kaleidoscope-LEDControl.cpp @@ -130,8 +130,12 @@ Key LEDControl::eventHandler(Key mappedKey, byte row, byte col, uint8_t keyState if (mappedKey.flags != (SYNTHETIC | IS_INTERNAL | LED_TOGGLE)) return mappedKey; - if (keyToggledOn(keyState)) - next_mode(); + if (keyToggledOn(keyState)) { + if (mappedKey == Key_LEDEffectNext) + next_mode(); + else + prev_mode(); + } return Key_NoKey; } diff --git a/src/Kaleidoscope-LEDControl.h b/src/Kaleidoscope-LEDControl.h index dcaf6fb9..a0f1327d 100644 --- a/src/Kaleidoscope-LEDControl.h +++ b/src/Kaleidoscope-LEDControl.h @@ -7,6 +7,7 @@ #define LED_TOGGLE B00000001 // Synthetic, internal #define Key_LEDEffectNext (Key) { 0, KEY_FLAGS | SYNTHETIC | IS_INTERNAL | LED_TOGGLE } +#define Key_LEDEffectPrevious (Key) { 1, KEY_FLAGS | SYNTHETIC | IS_INTERNAL | LED_TOGGLE } namespace kaleidoscope { /** Base class for LED modes.