From 4e0e149cd33664da5c33ca3598a5985a83459fec Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Oct 2018 14:49:17 +0200 Subject: [PATCH] Rearrange the file layout in preparation of becoming a monorepo Move the documentation to `doc/plugin/LED-ActiveModColor.md`, sources under `src/kaleidoscope/plugin/` (appropriately namespaced). This is in preparation of merging plugins into a single monorepo. Signed-off-by: Gergely Nagy --- README.md | 55 +----------------- doc/plugin/LED-ActiveModColor.md | 56 +++++++++++++++++++ src/Kaleidoscope-LED-ActiveModColor.h | 2 +- .../plugin}/LED-ActiveModColor.cpp | 4 +- .../plugin}/LED-ActiveModColor.h | 4 +- 5 files changed, 64 insertions(+), 57 deletions(-) create mode 100644 doc/plugin/LED-ActiveModColor.md rename src/{Kaleidoscope => kaleidoscope/plugin}/LED-ActiveModColor.cpp (96%) rename src/{Kaleidoscope => kaleidoscope/plugin}/LED-ActiveModColor.h (91%) diff --git a/README.md b/README.md index ba4b7dd0..23eb72b2 100644 --- a/README.md +++ b/README.md @@ -5,57 +5,4 @@ [travis:image]: https://travis-ci.org/keyboardio/Kaleidoscope-LED-ActiveModColor.svg?branch=master [travis:status]: https://travis-ci.org/keyboardio/Kaleidoscope-LED-ActiveModColor -With this plugin, any active modifier on the keyboard will have the LED under it -highlighted. No matter how the modifier got activated (a key press, a macro, -anything else), the coloring will apply. Layer keys, be them layer toggles, -momentary switches, or one-shot layer keys count as modifiers as far as the -plugin is concerned. - -## Using the plugin - -To use the plugin, one needs to include the header, and activate the effect. It -is also possible to use a custom color instead of the white default. - -```c++ -#include -#include -#include - -KALEIDOSCOPE_INIT_PLUGINS(LEDControl, - ActiveModColorEffect); - -void setup () { - Kaleidoscope.setup (); - - ActiveModColorEffect.highlight_color = CRGB(0x00, 0xff, 0xff); -} -``` - -It is recommended to place the activation (the `KALEIDOSCOPE_INIT_PLUGINS` parameter) of the -plugin last, so that it can reliably override any other plugins that may work -with the LEDs, and apply the highlight over those. - -## Plugin properties - -The plugin provides the `ActiveModColorEffect` object, which has the following -properties: - -### `.highlight_color` - -> The color to use for highlighting the modifiers. Defaults to a white color. - -### `.sticky_color` - -> The color to use for highlighting one-shot modifiers when they are sticky. Defaults to a red color. - -## Dependencies - -* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl) -* [Kaleidoscope-OneShot](https://github.com/keyboardio/Kaleidoscope-OneShot) - -## Further reading - -Starting from the [example][plugin:example] is the recommended way of getting -started with the plugin. - - [plugin:example]: https://github.com/keyboardio/Kaleidoscope-LED-ActiveModColor/blob/master/examples/LED-ActiveModColor/LED-ActiveModColor.ino +See [doc/plugin/LED-ActiveModColor.md](doc/plugin/LED-ActiveModColor.md) for documentation. diff --git a/doc/plugin/LED-ActiveModColor.md b/doc/plugin/LED-ActiveModColor.md new file mode 100644 index 00000000..259f6c3c --- /dev/null +++ b/doc/plugin/LED-ActiveModColor.md @@ -0,0 +1,56 @@ +# Kaleidoscope-LED-ActiveModColor + +With this plugin, any active modifier on the keyboard will have the LED under it +highlighted. No matter how the modifier got activated (a key press, a macro, +anything else), the coloring will apply. Layer keys, be them layer toggles, +momentary switches, or one-shot layer keys count as modifiers as far as the +plugin is concerned. + +## Using the plugin + +To use the plugin, one needs to include the header, and activate the effect. It +is also possible to use a custom color instead of the white default. + +```c++ +#include +#include +#include + +KALEIDOSCOPE_INIT_PLUGINS(LEDControl, + ActiveModColorEffect); + +void setup () { + Kaleidoscope.setup (); + + ActiveModColorEffect.highlight_color = CRGB(0x00, 0xff, 0xff); +} +``` + +It is recommended to place the activation (the `KALEIDOSCOPE_INIT_PLUGINS` parameter) of the +plugin last, so that it can reliably override any other plugins that may work +with the LEDs, and apply the highlight over those. + +## Plugin properties + +The plugin provides the `ActiveModColorEffect` object, which has the following +properties: + +### `.highlight_color` + +> The color to use for highlighting the modifiers. Defaults to a white color. + +### `.sticky_color` + +> The color to use for highlighting one-shot modifiers when they are sticky. Defaults to a red color. + +## Dependencies + +* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl) +* [Kaleidoscope-OneShot](https://github.com/keyboardio/Kaleidoscope-OneShot) + +## Further reading + +Starting from the [example][plugin:example] is the recommended way of getting +started with the plugin. + + [plugin:example]: https://github.com/keyboardio/Kaleidoscope-LED-ActiveModColor/blob/master/examples/LED-ActiveModColor/LED-ActiveModColor.ino diff --git a/src/Kaleidoscope-LED-ActiveModColor.h b/src/Kaleidoscope-LED-ActiveModColor.h index 7fe92f0b..b74abb82 100644 --- a/src/Kaleidoscope-LED-ActiveModColor.h +++ b/src/Kaleidoscope-LED-ActiveModColor.h @@ -17,4 +17,4 @@ #pragma once -#include +#include diff --git a/src/Kaleidoscope/LED-ActiveModColor.cpp b/src/kaleidoscope/plugin/LED-ActiveModColor.cpp similarity index 96% rename from src/Kaleidoscope/LED-ActiveModColor.cpp rename to src/kaleidoscope/plugin/LED-ActiveModColor.cpp index d8ed6240..710f39be 100644 --- a/src/Kaleidoscope/LED-ActiveModColor.cpp +++ b/src/kaleidoscope/plugin/LED-ActiveModColor.cpp @@ -20,6 +20,7 @@ #include namespace kaleidoscope { +namespace plugin { cRGB ActiveModColorEffect::highlight_color = (cRGB) { 0xff, 0xff, 0xff @@ -60,6 +61,7 @@ EventHandlerResult ActiveModColorEffect::beforeReportingState() { return EventHandlerResult::OK; } +} } -kaleidoscope::ActiveModColorEffect ActiveModColorEffect; +kaleidoscope::plugin::ActiveModColorEffect ActiveModColorEffect; diff --git a/src/Kaleidoscope/LED-ActiveModColor.h b/src/kaleidoscope/plugin/LED-ActiveModColor.h similarity index 91% rename from src/Kaleidoscope/LED-ActiveModColor.h rename to src/kaleidoscope/plugin/LED-ActiveModColor.h index f2d4fdb0..6beb7889 100644 --- a/src/Kaleidoscope/LED-ActiveModColor.h +++ b/src/kaleidoscope/plugin/LED-ActiveModColor.h @@ -21,6 +21,7 @@ #include namespace kaleidoscope { +namespace plugin { class ActiveModColorEffect : public kaleidoscope::Plugin { public: ActiveModColorEffect(void) {} @@ -31,5 +32,6 @@ class ActiveModColorEffect : public kaleidoscope::Plugin { EventHandlerResult beforeReportingState(); }; } +} -extern kaleidoscope::ActiveModColorEffect ActiveModColorEffect; +extern kaleidoscope::plugin::ActiveModColorEffect ActiveModColorEffect;