diff --git a/README.md b/README.md index 36c3ad59..05f0f63a 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ enabling the plugin: #include void setup () { - Kaleidoscope.setup (KEYMAP_SIZE); - Kaleidoscope.use (&SpaceCadetShift, NULL); + Kaleidoscope.setup (); + USE_PLUGINS (&SpaceCadetShift); } ``` @@ -63,19 +63,10 @@ The plugin has a number of methods available on the `SpaceCadetShift` object: ```c++ void setup () { SpaceCadetShift.configure(Key_8, Key_9); - Kaleidoscope.setup (KEYMAP_SIZE); + Kaleidoscope.setup (); } ``` -### `.on()` - -> This method turns the SpaceCadet Shift behaviour on, if it was turned off. - -### `.off()` - -> Turns the SpaceCadet Shift behaviour off, making the `Shift` keys work as they -> did before, without the additional behaviour. - ### `.timeOut` > The number of milliseconds to wait before considering a held key in isolation diff --git a/examples/SpaceCadet/SpaceCadet.ino b/examples/SpaceCadet/SpaceCadet.ino index 1be9b3f5..dbe3944d 100644 --- a/examples/SpaceCadet/SpaceCadet.ino +++ b/examples/SpaceCadet/SpaceCadet.ino @@ -41,8 +41,8 @@ const Key keymaps[][ROWS][COLS] PROGMEM = { }; void setup () { - Kaleidoscope.setup (KEYMAP_SIZE); - Kaleidoscope.use (&SpaceCadetShift, NULL); + Kaleidoscope.setup (); + USE_PLUGINS (&SpaceCadetShift); } void loop () { diff --git a/src/Kaleidoscope/SpaceCadet.cpp b/src/Kaleidoscope/SpaceCadet.cpp index fb7c971f..3ba598b3 100644 --- a/src/Kaleidoscope/SpaceCadet.cpp +++ b/src/Kaleidoscope/SpaceCadet.cpp @@ -41,21 +41,6 @@ namespace KaleidoscopePlugins { rightParen = right; } - void - SpaceCadetShift::on (void) { - event_handler_hook_replace (this->noOpHook, this->eventHandlerHook); - } - - void - SpaceCadetShift::off (void) { - event_handler_hook_replace (this->eventHandlerHook, this->noOpHook); - } - - Key - SpaceCadetShift::noOpHook (Key mappedKey, byte row, byte col, uint8_t keyState) { - return mappedKey; - } - Key SpaceCadetShift::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) { // If nothing happened, bail out fast. diff --git a/src/Kaleidoscope/SpaceCadet.h b/src/Kaleidoscope/SpaceCadet.h index 56041341..1f062ee1 100644 --- a/src/Kaleidoscope/SpaceCadet.h +++ b/src/Kaleidoscope/SpaceCadet.h @@ -30,15 +30,12 @@ namespace KaleidoscopePlugins { static void configure (Key left, Key right); static uint16_t timeOut; - void on (void); - void off (void); private: static uint8_t parenNeeded; static uint32_t startTime; static Key leftParen, rightParen; static Key eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState); - static Key noOpHook (Key, byte row, byte col, uint8_t keyState); }; };