Apply `clang-format` to example sketches

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1157/head
Michael Richters 3 years ago
parent 56c12996ad
commit f9697e25f3
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -32,7 +32,6 @@
#include "Kaleidoscope-SpaceCadet.h" #include "Kaleidoscope-SpaceCadet.h"
#define MO(n) ShiftToLayer(n) #define MO(n) ShiftToLayer(n)
#define TG(n) LockLayer(n) #define TG(n) LockLayer(n)
@ -42,14 +41,14 @@ enum {
}; };
#define Key_Exclamation LSHIFT(Key_1) #define Key_Exclamation LSHIFT(Key_1)
#define Key_At LSHIFT(Key_2) #define Key_At LSHIFT(Key_2)
#define Key_Hash LSHIFT(Key_3) #define Key_Hash LSHIFT(Key_3)
#define Key_Dollar LSHIFT(Key_4) #define Key_Dollar LSHIFT(Key_4)
#define Key_Percent LSHIFT(Key_5) #define Key_Percent LSHIFT(Key_5)
#define Key_Caret LSHIFT(Key_6) #define Key_Caret LSHIFT(Key_6)
#define Key_And LSHIFT(Key_7) #define Key_And LSHIFT(Key_7)
#define Key_Star LSHIFT(Key_8) #define Key_Star LSHIFT(Key_8)
#define Key_Plus LSHIFT(Key_Equals) #define Key_Plus LSHIFT(Key_Equals)
enum { enum {
QWERTY, QWERTY,
@ -110,8 +109,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
SpaceCadet, SpaceCadet,
OneShot, OneShot,
Macros, Macros,
MouseKeys MouseKeys);
);
const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
if (keyToggledOn(event.state)) { if (keyToggledOn(event.state)) {

@ -50,8 +50,9 @@
#include "Kaleidoscope-USB-Quirks.h" #include "Kaleidoscope-USB-Quirks.h"
enum { _QWERTY, enum {
}; _QWERTY,
};
// clang-format off // clang-format off
@ -70,7 +71,6 @@ Key_F5, Key_LeftControl,Key_LeftAlt, Key_LeftGui, Key_Backspace, Key_LeftAr
// clang-format on // clang-format on
// These 'solid' color effect definitions define a rainbow of // These 'solid' color effect definitions define a rainbow of
// LED color modes calibrated to draw 500mA or less on the // LED color modes calibrated to draw 500mA or less on the
// Keyboardio Model 01. // Keyboardio Model 01.
@ -133,51 +133,57 @@ static void toggleKeyboardProtocol(uint8_t combo_index) {
/** Magic combo list, a list of key combo and action pairs the firmware should /** Magic combo list, a list of key combo and action pairs the firmware should
* recognise. * recognise.
*/ */
USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol, USE_MAGIC_COMBOS(
// Left Fn + Esc + Shift {.action = toggleKeyboardProtocol,
.keys = { R3C6, R2C6, R3C7 } // Left Fn + Esc + Shift
}); .keys = {R3C6, R2C6, R3C7}});
KALEIDOSCOPE_INIT_PLUGINS(Macros, KALEIDOSCOPE_INIT_PLUGINS(
Macros,
// LEDControl provides support for other LED modes // LEDControl provides support for other LED modes
LEDControl, LEDControl,
// The rainbow effect changes the color of all of the keyboard's keys at the same time // The rainbow effect changes the color of all of the keyboard's keys at the same time
// running through all the colors of the rainbow. // running through all the colors of the rainbow.
LEDRainbowEffect, LEDRainbowEffect,
// The rainbow wave effect lights up your keyboard with all the colors of a rainbow // The rainbow wave effect lights up your keyboard with all the colors of a rainbow
// and slowly moves the rainbow across your keyboard // and slowly moves the rainbow across your keyboard
LEDRainbowWaveEffect, LEDRainbowWaveEffect,
// The chase effect follows the adventure of a blue pixel which chases a red pixel across // The chase effect follows the adventure of a blue pixel which chases a red pixel across
// your keyboard. Spoiler: the blue pixel never catches the red pixel // your keyboard. Spoiler: the blue pixel never catches the red pixel
LEDChaseEffect, LEDChaseEffect,
// These static effects turn your keyboard's LEDs a variety of colors // These static effects turn your keyboard's LEDs a variety of colors
solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, solidRed,
solidOrange,
solidYellow,
solidGreen,
solidBlue,
solidIndigo,
solidViolet,
// The breathe effect slowly pulses all of the LEDs on your keyboard // The breathe effect slowly pulses all of the LEDs on your keyboard
LEDBreatheEffect, LEDBreatheEffect,
// The HostPowerManagement plugin allows us to turn LEDs off when then host // The HostPowerManagement plugin allows us to turn LEDs off when then host
// goes to sleep, and resume them when it wakes up. // goes to sleep, and resume them when it wakes up.
HostPowerManagement, HostPowerManagement,
// The MagicCombo plugin lets you use key combinations to trigger custom // The MagicCombo plugin lets you use key combinations to trigger custom
// actions - a bit like Macros, but triggered by pressing multiple keys at the // actions - a bit like Macros, but triggered by pressing multiple keys at the
// same time. // same time.
MagicCombo, MagicCombo,
// The USBQuirks plugin lets you do some things with USB that we aren't // The USBQuirks plugin lets you do some things with USB that we aren't
// comfortable - or able - to do automatically, but can be useful // comfortable - or able - to do automatically, but can be useful
// nevertheless. Such as toggling the key report protocol between Boot (used // nevertheless. Such as toggling the key report protocol between Boot (used
// by BIOSes) and Report (NKRO). // by BIOSes) and Report (NKRO).
USBQuirks USBQuirks);
);
void setup() { void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();

@ -86,10 +86,17 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
if (macro_id == 1 && keyToggledOn(event.state)) { if (macro_id == 1 && keyToggledOn(event.state)) {
Kaleidoscope.serialPort().print("Keyboard.IO keyboard driver v0.00"); Kaleidoscope.serialPort().print("Keyboard.IO keyboard driver v0.00");
return MACRO(I(25), return MACRO(I(25),
D(LeftShift), T(M), U(LeftShift), T(O), T(D), T(E), T(L), D(LeftShift),
T(M),
U(LeftShift),
T(O),
T(D),
T(E),
T(L),
T(Spacebar), T(Spacebar),
W(100), W(100),
T(0), T(1)); T(0),
T(1));
} }
return MACRO_NONE; return MACRO_NONE;
} }
@ -105,16 +112,24 @@ static void enterHardwareTestMode(uint8_t combo_index) {
/** Magic combo list, a list of key combo and action pairs the firmware should /** Magic combo list, a list of key combo and action pairs the firmware should
* recognise. * recognise.
*/ */
USE_MAGIC_COMBOS({ USE_MAGIC_COMBOS({.action = enterHardwareTestMode,
.action = enterHardwareTestMode, // Left Fn + Prog + LED
// Left Fn + Prog + LED .keys = {R3C6, R0C0, R0C6}});
.keys = { R3C6, R0C0, R0C6 }
});
KALEIDOSCOPE_INIT_PLUGINS(HardwareTestMode, KALEIDOSCOPE_INIT_PLUGINS(HardwareTestMode,
LEDControl, LEDOff, LEDControl,
solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, LEDOff,
LEDBreatheEffect, LEDRainbowEffect, LEDChaseEffect, NumPad, solidRed,
solidOrange,
solidYellow,
solidGreen,
solidBlue,
solidIndigo,
solidViolet,
LEDBreatheEffect,
LEDRainbowEffect,
LEDChaseEffect,
NumPad,
Macros, Macros,
MouseKeys, MouseKeys,
MagicCombo); MagicCombo);

@ -88,10 +88,10 @@
* a macro key is pressed. * a macro key is pressed.
*/ */
enum { MACRO_VERSION_INFO, enum {
MACRO_ANY MACRO_VERSION_INFO,
}; MACRO_ANY,
};
/** The Model 100's key layouts are defined as 'keymaps'. By default, there are three /** The Model 100's key layouts are defined as 'keymaps'. By default, there are three
@ -142,7 +142,11 @@ enum { MACRO_VERSION_INFO,
* *
*/ */
enum { PRIMARY, NUMPAD, FUNCTION }; // layers enum {
PRIMARY,
NUMPAD,
FUNCTION,
}; // layers
/** /**
@ -164,7 +168,6 @@ enum { PRIMARY, NUMPAD, FUNCTION }; // layers
// #define PRIMARY_KEYMAP_CUSTOM // #define PRIMARY_KEYMAP_CUSTOM
/* This comment temporarily turns off astyle's indent enforcement /* This comment temporarily turns off astyle's indent enforcement
* so we can make the keymaps actually resemble the physical key layout better * so we can make the keymaps actually resemble the physical key layout better
*/ */
@ -336,7 +339,6 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
} }
// These 'solid' color effect definitions define a rainbow of // These 'solid' color effect definitions define a rainbow of
// LED color modes calibrated to draw 500mA or less on the // LED color modes calibrated to draw 500mA or less on the
// Keyboardio Model 100. // Keyboardio Model 100.
@ -412,12 +414,10 @@ static void enterHardwareTestMode(uint8_t combo_index) {
*/ */
USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol, USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol,
// Left Fn + Esc + Shift // Left Fn + Esc + Shift
.keys = { R3C6, R2C6, R3C7 } .keys = {R3C6, R2C6, R3C7}},
}, { {.action = enterHardwareTestMode,
.action = enterHardwareTestMode, // Left Fn + Prog + LED
// Left Fn + Prog + LED .keys = {R3C6, R0C0, R0C6}});
.keys = { R3C6, R0C0, R0C6 }
});
// First, tell Kaleidoscope which plugins you want to use. // First, tell Kaleidoscope which plugins you want to use.
// The order can be important. For example, LED effects are // The order can be important. For example, LED effects are
@ -468,7 +468,13 @@ KALEIDOSCOPE_INIT_PLUGINS(
LEDChaseEffect, LEDChaseEffect,
// These static effects turn your keyboard's LEDs a variety of colors // These static effects turn your keyboard's LEDs a variety of colors
solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, solidRed,
solidOrange,
solidYellow,
solidGreen,
solidBlue,
solidIndigo,
solidViolet,
// The breathe effect slowly pulses all of the LEDs on your keyboard // The breathe effect slowly pulses all of the LEDs on your keyboard
LEDBreatheEffect, LEDBreatheEffect,
@ -510,8 +516,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
// comfortable - or able - to do automatically, but can be useful // comfortable - or able - to do automatically, but can be useful
// nevertheless. Such as toggling the key report protocol between Boot (used // nevertheless. Such as toggling the key report protocol between Boot (used
// by BIOSes) and Report (NKRO). // by BIOSes) and Report (NKRO).
USBQuirks USBQuirks);
);
/** The 'setup' function is one of the two standard Arduino sketch functions. /** The 'setup' function is one of the two standard Arduino sketch functions.
* It's called when your keyboard first powers up. This is where you set up * It's called when your keyboard first powers up. This is where you set up

@ -20,14 +20,15 @@
#include "Kaleidoscope.h" #include "Kaleidoscope.h"
#include "Kaleidoscope-Macros.h" #include "Kaleidoscope-Macros.h"
enum { _QWERTY, enum {
_COLEMAK, _QWERTY,
_DVORAK, _COLEMAK,
_LOWER, _DVORAK,
_RAISE, _LOWER,
_PLOVER, _RAISE,
_ADJUST _PLOVER,
}; _ADJUST
};
// clang-format off // clang-format off

@ -30,12 +30,12 @@ enum {
}; };
#define Key_Exclamation LSHIFT(Key_1) #define Key_Exclamation LSHIFT(Key_1)
#define Key_At LSHIFT(Key_2) #define Key_At LSHIFT(Key_2)
#define Key_Hash LSHIFT(Key_3) #define Key_Hash LSHIFT(Key_3)
#define Key_Dollar LSHIFT(Key_4) #define Key_Dollar LSHIFT(Key_4)
#define Key_And LSHIFT(Key_7) #define Key_And LSHIFT(Key_7)
#define Key_Star LSHIFT(Key_8) #define Key_Star LSHIFT(Key_8)
#define Key_Plus LSHIFT(Key_Equals) #define Key_Plus LSHIFT(Key_Equals)
// clang-format off // clang-format off
KEYMAPS( KEYMAPS(

@ -46,8 +46,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
EEPROMSettings, EEPROMSettings,
EEPROMKeymap, EEPROMKeymap,
DynamicMacros, DynamicMacros,
Focus Focus);
);
void setup() { void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();

@ -70,7 +70,7 @@ class FocusHelpCommand : public Plugin {
} }
}; };
} } // namespace kaleidoscope
kaleidoscope::FocusTestCommand FocusTestCommand; kaleidoscope::FocusTestCommand FocusTestCommand;
kaleidoscope::FocusHelpCommand FocusHelpCommand; kaleidoscope::FocusHelpCommand FocusHelpCommand;

@ -61,12 +61,13 @@ class EventDropper : public Plugin {
void toggle() { void toggle() {
active_ = !active_; active_ = !active_;
} }
private: private:
bool active_ = false; bool active_ = false;
}; };
} // namespace plugin } // namespace plugin
} // namespace kaleidoscope } // namespace kaleidoscope
kaleidoscope::plugin::EventDropper EventDropper; kaleidoscope::plugin::EventDropper EventDropper;
@ -95,8 +96,7 @@ static const kaleidoscope::plugin::GhostInTheFirmware::GhostKey ghost_keys[] PRO
{KeyAddr(3, 14), 200, 50}, {KeyAddr(3, 14), 200, 50},
{KeyAddr(3, 15), 200, 50}, {KeyAddr(3, 15), 200, 50},
{KeyAddr::none(), 0, 0} {KeyAddr::none(), 0, 0}};
};
KALEIDOSCOPE_INIT_PLUGINS(GhostInTheFirmware, KALEIDOSCOPE_INIT_PLUGINS(GhostInTheFirmware,
LEDControl, LEDControl,
@ -107,7 +107,7 @@ KALEIDOSCOPE_INIT_PLUGINS(GhostInTheFirmware,
void setup() { void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();
StalkerEffect.variant = STALKER(BlazingTrail); StalkerEffect.variant = STALKER(BlazingTrail);
GhostInTheFirmware.ghost_keys = ghost_keys; GhostInTheFirmware.ghost_keys = ghost_keys;
} }

@ -19,7 +19,11 @@
#include <Kaleidoscope-FocusSerial.h> #include <Kaleidoscope-FocusSerial.h>
#include <Kaleidoscope-MouseKeys.h> #include <Kaleidoscope-MouseKeys.h>
enum { PRIMARY, NUMPAD, FUNCTION }; // layers enum {
PRIMARY,
NUMPAD,
FUNCTION,
}; // layers
// clang-format off // clang-format off
KEYMAPS( KEYMAPS(
@ -71,7 +75,7 @@ KEYMAPS(
// clang-format on // clang-format on
namespace kaleidoscope { namespace kaleidoscope {
class LayerDumper: public Plugin { class LayerDumper : public Plugin {
public: public:
LayerDumper() {} LayerDumper() {}
@ -89,7 +93,7 @@ class LayerDumper: public Plugin {
} }
}; };
} } // namespace kaleidoscope
kaleidoscope::LayerDumper LayerDumper; kaleidoscope::LayerDumper LayerDumper;

@ -64,11 +64,10 @@ class ShiftBlocker : public Plugin {
private: private:
bool active_{false}; bool active_{false};
}; };
} // namespace plugin } // namespace plugin
} // namespace kaleidoscope } // namespace kaleidoscope
kaleidoscope::plugin::ShiftBlocker ShiftBlocker; kaleidoscope::plugin::ShiftBlocker ShiftBlocker;

@ -44,7 +44,7 @@ KEYMAPS(
) )
// clang-format on // clang-format on
using namespace kaleidoscope::sketch_exploration; // NOLINT(build/namespaces) using namespace kaleidoscope::sketch_exploration; // NOLINT(build/namespaces)
class BPlugin : public kaleidoscope::Plugin {}; class BPlugin : public kaleidoscope::Plugin {};
class CPlugin : public kaleidoscope::Plugin {}; class CPlugin : public kaleidoscope::Plugin {};
@ -54,7 +54,8 @@ class CPlugin : public kaleidoscope::Plugin {};
class APlugin : public kaleidoscope::Plugin { class APlugin : public kaleidoscope::Plugin {
public: public:
APlugin() : has_key_1_{false} {} APlugin()
: has_key_1_{false} {}
template<typename _Sketch> template<typename _Sketch>
kaleidoscope::EventHandlerResult exploreSketch() { kaleidoscope::EventHandlerResult exploreSketch() {
@ -72,7 +73,7 @@ class APlugin : public kaleidoscope::Plugin {
constexpr bool has_key_1 = K::collect(HasKey{Key_1}); constexpr bool has_key_1 = K::collect(HasKey{Key_1});
static_assert(has_key_1, "Error querying key existence"); static_assert(has_key_1, "Error querying key existence");
has_key_1_ = has_key_1; // Assign the temporary that was computed has_key_1_ = has_key_1; // Assign the temporary that was computed
// at compile time. // at compile time.
constexpr Key max_key = K::collect(MaxKeyRaw{}); constexpr Key max_key = K::collect(MaxKeyRaw{});
@ -81,7 +82,7 @@ class APlugin : public kaleidoscope::Plugin {
static_assert(K::getKey(0 /*layer*/, KeyAddr{2, 3}) == Key_D, static_assert(K::getKey(0 /*layer*/, KeyAddr{2, 3}) == Key_D,
"Key lookup failed"); "Key lookup failed");
constexpr auto n_layers = K::nLayers(); constexpr auto n_layers = K::nLayers();
constexpr auto layer_size = K::layerSize(); constexpr auto layer_size = K::layerSize();
// Plugin exploration // Plugin exploration
@ -117,7 +118,6 @@ class APlugin : public kaleidoscope::Plugin {
} }
private: private:
bool has_key_1_; bool has_key_1_;
}; };
@ -127,8 +127,7 @@ BPlugin b_plugin;
KALEIDOSCOPE_INIT_PLUGINS( KALEIDOSCOPE_INIT_PLUGINS(
a_plugin1, a_plugin1,
b_plugin, b_plugin,
a_plugin2 a_plugin2)
)
void setup() { void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();

@ -56,8 +56,8 @@ KALEIDOSCOPE_INIT_PLUGINS(
FocusEEPROMCommand, // for AutoShiftConfig FocusEEPROMCommand, // for AutoShiftConfig
FocusSettingsCommand, // for AutoShiftConfig FocusSettingsCommand, // for AutoShiftConfig
AutoShift, AutoShift,
AutoShiftConfig, // for AutoShiftConfig AutoShiftConfig, // for AutoShiftConfig
Macros // for toggle AutoShift Macro Macros // for toggle AutoShift Macro
); );
void setup() { void setup() {

@ -31,9 +31,9 @@ KALEIDOSCOPE_INIT_PLUGINS(CharShift);
void setup() { void setup() {
CS_KEYS( CS_KEYS(
kaleidoscope::plugin::CharShift::KeyPair(Key_Comma, Key_Semicolon), // CS(0) kaleidoscope::plugin::CharShift::KeyPair(Key_Comma, Key_Semicolon), // CS(0)
kaleidoscope::plugin::CharShift::KeyPair(Key_Period, LSHIFT(Key_Semicolon)), // CS(1) kaleidoscope::plugin::CharShift::KeyPair(Key_Period, LSHIFT(Key_Semicolon)), // CS(1)
kaleidoscope::plugin::CharShift::KeyPair(LSHIFT(Key_Comma), LSHIFT(Key_Period)), // CS(2) kaleidoscope::plugin::CharShift::KeyPair(LSHIFT(Key_Comma), LSHIFT(Key_Period)), // CS(2)
); );
Kaleidoscope.setup(); Kaleidoscope.setup();
} }

@ -50,8 +50,8 @@ static void leaderTestAA(uint8_t seq_index) {
} }
static const kaleidoscope::plugin::Leader::dictionary_t leader_dictionary[] PROGMEM = static const kaleidoscope::plugin::Leader::dictionary_t leader_dictionary[] PROGMEM =
LEADER_DICT({LEADER_SEQ(LEAD(0), Key_A), leaderTestA}, LEADER_DICT({LEADER_SEQ(LEAD(0), Key_A), leaderTestA},
{LEADER_SEQ(LEAD(0), Key_A, Key_A), leaderTestAA}); {LEADER_SEQ(LEAD(0), Key_A, Key_A), leaderTestAA});
KALEIDOSCOPE_INIT_PLUGINS(Leader); KALEIDOSCOPE_INIT_PLUGINS(Leader);

@ -74,7 +74,7 @@ class LeaderPrefix : public Plugin {
if (keyToggledOn(event.state) && isLeaderKey(event.key)) { if (keyToggledOn(event.state) && isLeaderKey(event.key)) {
// A Leader key toggled on, so we set our state to "active", and set the // A Leader key toggled on, so we set our state to "active", and set the
// arg value to zero. // arg value to zero.
active_ = true; active_ = true;
leader_arg_ = 0; leader_arg_ = 0;
} }
// Whether or not the plugin just became active, there's nothing more to // Whether or not the plugin just became active, there's nothing more to
@ -122,8 +122,16 @@ class LeaderPrefix : public Plugin {
private: private:
// The "digit keys": these are the keys on the number row of the Model01. // The "digit keys": these are the keys on the number row of the Model01.
KeyAddr digit_addrs_[10] = { KeyAddr digit_addrs_[10] = {
KeyAddr(0, 14), KeyAddr(0, 1), KeyAddr(0, 2), KeyAddr(0, 3), KeyAddr(0, 4), KeyAddr(0, 14),
KeyAddr(0, 5), KeyAddr(0, 10), KeyAddr(0, 11), KeyAddr(0, 12), KeyAddr(0, 13), KeyAddr(0, 1),
KeyAddr(0, 2),
KeyAddr(0, 3),
KeyAddr(0, 4),
KeyAddr(0, 5),
KeyAddr(0, 10),
KeyAddr(0, 11),
KeyAddr(0, 12),
KeyAddr(0, 13),
}; };
// This event tracker is necessary to prevent re-processing events. Any // This event tracker is necessary to prevent re-processing events. Any
@ -144,8 +152,8 @@ class LeaderPrefix : public Plugin {
} }
}; };
} // namespace plugin } // namespace plugin
} // namespace kaleidoscope } // namespace kaleidoscope
// This creates our plugin object. // This creates our plugin object.
kaleidoscope::plugin::LeaderPrefix LeaderPrefix; kaleidoscope::plugin::LeaderPrefix LeaderPrefix;
@ -172,9 +180,9 @@ void leaderTestPrefix(uint8_t seq_index) {
} }
static const kaleidoscope::plugin::Leader::dictionary_t leader_dictionary[] PROGMEM = static const kaleidoscope::plugin::Leader::dictionary_t leader_dictionary[] PROGMEM =
LEADER_DICT({LEADER_SEQ(LEAD(0), Key_X), leaderTestX}, LEADER_DICT({LEADER_SEQ(LEAD(0), Key_X), leaderTestX},
{LEADER_SEQ(LEAD(0), Key_X, Key_X), leaderTestXX}, {LEADER_SEQ(LEAD(0), Key_X, Key_X), leaderTestXX},
{LEADER_SEQ(LEAD(0), Key_Z), leaderTestPrefix}); {LEADER_SEQ(LEAD(0), Key_Z), leaderTestPrefix});
// The order matters here; LeaderPrefix won't work unless it precedes Leader in // The order matters here; LeaderPrefix won't work unless it precedes Leader in
// this list. If there are other plugins in the list, these two should ideally // this list. If there are other plugins in the list, these two should ideally

@ -71,7 +71,7 @@ void macroTypeString(KeyEvent &event) {
} }
// Example macro for macro step sequence. // Example macro for macro step sequence.
const macro_t* macroSteps(KeyEvent &event) { const macro_t *macroSteps(KeyEvent &event) {
if (keyToggledOn(event.state)) { if (keyToggledOn(event.state)) {
// Note that the following sequence leaves two keys down (`Key_RightAlt` and // Note that the following sequence leaves two keys down (`Key_RightAlt` and
// `Key_C`). These virtual keys will remain in effect until the Macros key // `Key_C`). These virtual keys will remain in effect until the Macros key
@ -82,7 +82,7 @@ const macro_t* macroSteps(KeyEvent &event) {
} }
// Example macro that sets `event.key`. // Example macro that sets `event.key`.
const macro_t* macroNewSentence1(KeyEvent &event) { const macro_t *macroNewSentence1(KeyEvent &event) {
if (keyToggledOn(event.state)) { if (keyToggledOn(event.state)) {
event.key = OSM(LeftShift); event.key = OSM(LeftShift);
return MACRO(Tc(Period), Tc(Spacebar), Tc(Spacebar)); return MACRO(Tc(Period), Tc(Spacebar), Tc(Spacebar));
@ -114,7 +114,7 @@ void macroNewSentence3(KeyEvent &event) {
// Macro that auto-repeats? // Macro that auto-repeats?
const macro_t* macroAction(uint8_t macro_id, KeyEvent &event) { const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
switch (macro_id) { switch (macro_id) {
case 0: case 0:

@ -49,14 +49,14 @@ void setup() {
//Setting is {KeyThatWasPressed, AlternativeKeyToSend, TimeoutInMS} //Setting is {KeyThatWasPressed, AlternativeKeyToSend, TimeoutInMS}
//Note: must end with the SPACECADET_MAP_END delimiter //Note: must end with the SPACECADET_MAP_END delimiter
static kaleidoscope::plugin::SpaceCadet::KeyBinding spacecadetmap[] = { static kaleidoscope::plugin::SpaceCadet::KeyBinding spacecadetmap[] = {
{Key_LeftShift, Key_LeftParen, 250} {Key_LeftShift, Key_LeftParen, 250},
, {Key_RightShift, Key_RightParen, 250} {Key_RightShift, Key_RightParen, 250},
, {Key_LeftGui, Key_LeftCurlyBracket, 250} {Key_LeftGui, Key_LeftCurlyBracket, 250},
, {Key_RightAlt, Key_RightCurlyBracket, 250} {Key_RightAlt, Key_RightCurlyBracket, 250},
, {Key_LeftAlt, Key_RightCurlyBracket, 250} {Key_LeftAlt, Key_RightCurlyBracket, 250},
, {Key_LeftControl, Key_LeftBracket, 250} {Key_LeftControl, Key_LeftBracket, 250},
, {Key_RightControl, Key_RightBracket, 250} {Key_RightControl, Key_RightBracket, 250},
, SPACECADET_MAP_END SPACECADET_MAP_END,
}; };
//Set the map. //Set the map.
SpaceCadet.map = spacecadetmap; SpaceCadet.map = spacecadetmap;

@ -28,9 +28,8 @@ void toggleWinKey(uint8_t index) {
} }
USE_MAGIC_COMBOS([WINKEYTOGGLE] = { USE_MAGIC_COMBOS([WINKEYTOGGLE] = {
.action = toggleWinKey, .action = toggleWinKey,
.keys = {R3C6, R3C9} .keys = {R3C6, R3C9}});
});
// clang-format off // clang-format off
KEYMAPS( KEYMAPS(

@ -56,7 +56,7 @@ void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();
PersistentIdleLEDs.setIdleTimeoutSeconds(300); // 5 minutes PersistentIdleLEDs.setIdleTimeoutSeconds(300); // 5 minutes
LEDRainbowWaveEffect.activate(); LEDRainbowWaveEffect.activate();
} }

@ -66,8 +66,7 @@ KALEIDOSCOPE_INIT_PLUGINS(LEDControl,
void setup() { void setup() {
static const cRGB layerColormap[] PROGMEM = { static const cRGB layerColormap[] PROGMEM = {
CRGB(128, 0, 0), CRGB(128, 0, 0),
CRGB(0, 128, 0) CRGB(0, 128, 0)};
};
Kaleidoscope.setup(); Kaleidoscope.setup();
LEDActiveLayerColorEffect.setColormap(layerColormap); LEDActiveLayerColorEffect.setColormap(layerColormap);

@ -57,12 +57,12 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
col = 10; col = 10;
for (uint8_t step = 0; step <= 0xf0; step += 8) { for (uint8_t step = 0; step <= 0xf0; step += 8) {
AlphaSquare.color = { step, step, step }; AlphaSquare.color = {step, step, step};
AlphaSquare.display({i, 0}, col); AlphaSquare.display({i, 0}, col);
delay(10); delay(10);
} }
for (uint8_t step = 0xff; step >= 8; step -= 8) { for (uint8_t step = 0xff; step >= 8; step -= 8) {
AlphaSquare.color = { step, step, step }; AlphaSquare.color = {step, step, step};
AlphaSquare.display({i, 0}, col); AlphaSquare.display({i, 0}, col);
delay(10); delay(10);
} }
@ -74,14 +74,14 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
delay(100); delay(100);
for (uint8_t step = 0; step <= 0xf0; step += 8) { for (uint8_t step = 0; step <= 0xf0; step += 8) {
AlphaSquare.color = { step, step, step }; AlphaSquare.color = {step, step, step};
AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 2); AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 2);
AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 10); AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 10);
delay(10); delay(10);
} }
for (uint8_t step = 0xff; step >= 8; step -= 8) { for (uint8_t step = 0xff; step >= 8; step -= 8) {
AlphaSquare.color = { step, step, step }; AlphaSquare.color = {step, step, step};
AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 2); AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 2);
AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 10); AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 10);
delay(10); delay(10);
@ -102,7 +102,7 @@ KALEIDOSCOPE_INIT_PLUGINS(LEDControl,
void setup() { void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();
AlphaSquare.color = { 0xcb, 0xc0, 0xff }; AlphaSquare.color = {0xcb, 0xc0, 0xff};
} }
void loop() { void loop() {

@ -39,13 +39,11 @@ class TestLEDMode : public kaleidoscope::plugin::LEDMode {
uint16_t TestLEDMode::map_base_; uint16_t TestLEDMode::map_base_;
void void TestLEDMode::setup() {
TestLEDMode::setup() {
map_base_ = LEDPaletteTheme.reserveThemes(1); map_base_ = LEDPaletteTheme.reserveThemes(1);
} }
void void TestLEDMode::update(void) {
TestLEDMode::update(void) {
LEDPaletteTheme.updateHandler(map_base_, 0); LEDPaletteTheme.updateHandler(map_base_, 0);
} }
@ -54,7 +52,7 @@ TestLEDMode::onFocusEvent(const char *command) {
return LEDPaletteTheme.themeFocusEvent(command, PSTR("testLedMode.map"), map_base_, 1); return LEDPaletteTheme.themeFocusEvent(command, PSTR("testLedMode.map"), map_base_, 1);
} }
} } // namespace example
example::TestLEDMode TestLEDMode; example::TestLEDMode TestLEDMode;

@ -53,7 +53,7 @@ void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();
WavepoolEffect.idle_timeout = 5000; // 5 seconds WavepoolEffect.idle_timeout = 5000; // 5 seconds
WavepoolEffect.ripple_hue = WavepoolEffect.rainbow_hue; WavepoolEffect.ripple_hue = WavepoolEffect.rainbow_hue;
WavepoolEffect.activate(); WavepoolEffect.activate();
} }

Loading…
Cancel
Save