make astyle

pull/389/head
Jesse Vincent 8 years ago
parent 41970ac689
commit 1f8fc546e5
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -20,33 +20,33 @@
#include <Kaleidoscope-LED-ActiveModColor.h>
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);
Kaleidoscope.setup (KEYMAP_SIZE);
Kaleidoscope.use (&LEDControl, &ActiveModColorEffect, NULL);
ActiveModColorEffect.configure ({0x00, 0xff, 0xff});
ActiveModColorEffect.configure ({0x00, 0xff, 0xff});
}
void loop () {
Kaleidoscope.loop ();
Kaleidoscope.loop ();
}

@ -20,47 +20,49 @@
#include <Kaleidoscope-Ranges.h>
namespace KaleidoscopePlugins {
namespace LEDEffects {
cRGB ActiveModColorEffect::highlightColor = (cRGB) {0xff, 0xff, 0xff};
namespace LEDEffects {
cRGB ActiveModColorEffect::highlightColor = (cRGB) {
0xff, 0xff, 0xff
};
ActiveModColorEffect::ActiveModColorEffect (void) {
}
ActiveModColorEffect::ActiveModColorEffect (void) {
}
void
ActiveModColorEffect::begin (void) {
loop_hook_use (loopHook);
}
void
ActiveModColorEffect::begin (void) {
loop_hook_use (loopHook);
}
void
ActiveModColorEffect::configure (const cRGB highlightColor_) {
highlightColor = highlightColor_;
}
void
ActiveModColorEffect::configure (const cRGB highlightColor_) {
highlightColor = highlightColor_;
}
void
ActiveModColorEffect::loopHook (bool postClear) {
if (postClear)
void
ActiveModColorEffect::loopHook (bool postClear) {
if (postClear)
return;
for (byte r = 0; r < ROWS; r++) {
for (byte r = 0; r < ROWS; r++) {
for (byte c = 0; c < COLS; c++) {
Key k = Layer.lookup (r, 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);
}
}
}
}
};
};
};
KaleidoscopePlugins::LEDEffects::ActiveModColorEffect ActiveModColorEffect;

@ -20,19 +20,19 @@
#include <Kaleidoscope-LEDControl.h>
namespace KaleidoscopePlugins {
namespace LEDEffects {
class ActiveModColorEffect : public KaleidoscopePlugin {
public:
ActiveModColorEffect (void);
namespace LEDEffects {
class ActiveModColorEffect : public KaleidoscopePlugin {
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);
};
};
};
extern KaleidoscopePlugins::LEDEffects::ActiveModColorEffect ActiveModColorEffect;

Loading…
Cancel
Save