The Big Rename

Rename the library to Kaleidoscope-TapDance, and follow up with other renames.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 74070edcf1
commit b867f80ca2

@ -1,4 +1,4 @@
# Akela-TapDance # Kaleidoscope-TapDance
![status][st:stable] ![status][st:stable]
@ -40,20 +40,22 @@ This is to preserve the order of keys pressed.
In both of these cases, the [`tapDanceAction`][tdaction] will be called, with In both of these cases, the [`tapDanceAction`][tdaction] will be called, with
`tapDanceIndex` set to the index of the tap-dance action (as set in the keymap), `tapDanceIndex` set to the index of the tap-dance action (as set in the keymap),
the `tapCount`, and `tapDanceAction` set to either `Akela::TapDance::Interrupt`, the `tapCount`, and `tapDanceAction` set to either
or `Akela::TapDance::Timeout`. If we continue holding the key, then as long as `KaleidoscopePlugins::TapDance::Interrupt`, or
it is held, the same function will be called with `tapDanceAction` set to `KaleidoscopePlugins::TapDance::Timeout`. If we continue holding the key, then
`Akela::TapDance::Hold`. When the key is released, after either an `Interrupt` as long as it is held, the same function will be called with `tapDanceAction`
or `Timeout` action was triggered, the function will be called with set to `KaleidoscopePlugins::TapDance::Hold`. When the key is released, after
`tapDanceAction` set to `Akela::TapDance::Release`. either an `Interrupt` or `Timeout` action was triggered, the function will be
called with `tapDanceAction` set to `KaleidoscopePlugins::TapDance::Release`.
These actions allow us to create sophisticated tap-dance setups, where one can These actions allow us to create sophisticated tap-dance setups, where one can
tap a key twice and hold it, and have it repeat, for example. tap a key twice and hold it, and have it repeat, for example.
There is one additional value the `tapDanceAction` parameter can take: There is one additional value the `tapDanceAction` parameter can take:
`Akela::TapDance::Tap`. It is called with this argument for each and every tap, `KaleidoscopePlugins::TapDance::Tap`. It is called with this argument for each
even if no action is to be triggered yet. This is so that we can have a way to and every tap, even if no action is to be triggered yet. This is so that we can
do some side-effects, like light up LEDs to show progress, and so on. have a way to do some side-effects, like light up LEDs to show progress, and so
on.
## Using the plugin ## Using the plugin
@ -63,14 +65,15 @@ to implement the [`tapDanceAction`][tdaction] function that gets called each
time an action is to be performed. time an action is to be performed.
```c++ ```c++
#include <Akela-TapDance.h> #include <Kaleidoscope.h>
#include <Kaleidoscope-TapDance.h>
// Somewhere in the keymap: // Somewhere in the keymap:
TD(0) TD(0)
// later in the Sketch: // later in the Sketch:
void tapDanceAction (uint8_t tapDanceIndex, uint8_t tapCount, void tapDanceAction (uint8_t tapDanceIndex, uint8_t tapCount,
Akela::TapDance::ActionType tapDanceAction) { KaleidoscopePlugins::TapDance::ActionType tapDanceAction) {
switch (tapDanceIndex) { switch (tapDanceIndex) {
case 0: case 0:
return tapDanceActionKeys (tapCount, tapDanceAction, return tapDanceActionKeys (tapCount, tapDanceAction,
@ -79,8 +82,8 @@ void tapDanceAction (uint8_t tapDanceIndex, uint8_t tapCount,
} }
void setup (void) { void setup (void) {
Keyboardio.setup (KEYMAP_SIZE); Kaleidoscope.setup (KEYMAP_SIZE);
Keyboardio.use (&TapDance, NULL); Kaleidoscope.use (&TapDance, NULL);
} }
``` ```
@ -143,4 +146,4 @@ method only:
Starting from the [example][plugin:example] is the recommended way of getting Starting from the [example][plugin:example] is the recommended way of getting
started with the plugin. started with the plugin.
[plugin:example]: https://github.com/keyboardio/Akela-TapDance/blob/master/examples/TapDance/TapDance.ino [plugin:example]: https://github.com/keyboardio/Kaleidoscope-TapDance/blob/master/examples/TapDance/TapDance.ino

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* Akela -- Animated Keyboardio Extension Library for Anything * Kaleidoscope-TapDance -- Tap-dance keys
* Copyright (C) 2016, 2017 Gergely Nagy * Copyright (C) 2016, 2017 Gergely Nagy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -16,7 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <Akela-TapDance.h> #include <Kaleidoscope.h>
#include <Kaleidoscope-TapDance.h>
const Key keymaps[][ROWS][COLS] PROGMEM = { const Key keymaps[][ROWS][COLS] PROGMEM = {
[0] = KEYMAP_STACKED [0] = KEYMAP_STACKED
@ -39,11 +40,11 @@ const Key keymaps[][ROWS][COLS] PROGMEM = {
), ),
}; };
static void tapDanceEsc (uint8_t tapDanceIndex, uint8_t tapCount, Akela::TapDance::ActionType tapDanceAction) { static void tapDanceEsc (uint8_t tapDanceIndex, uint8_t tapCount, KaleidoscopePlugins::TapDance::ActionType tapDanceAction) {
tapDanceActionKeys (tapCount, tapDanceAction, Key_Esc, Key_Tab); tapDanceActionKeys (tapCount, tapDanceAction, Key_Esc, Key_Tab);
} }
void tapDanceAction (uint8_t tapDanceIndex, byte row, byte col, uint8_t tapCount, Akela::TapDance::ActionType tapDanceAction) { void tapDanceAction (uint8_t tapDanceIndex, byte row, byte col, uint8_t tapCount, KaleidoscopePlugins::TapDance::ActionType tapDanceAction) {
switch (tapDanceIndex) { switch (tapDanceIndex) {
case 0: case 0:
return tapDanceActionKeys (tapCount, tapDanceAction, Key_Tab, Key_Esc); return tapDanceActionKeys (tapCount, tapDanceAction, Key_Tab, Key_Esc);
@ -53,10 +54,10 @@ void tapDanceAction (uint8_t tapDanceIndex, byte row, byte col, uint8_t tapCount
} }
void setup () { void setup () {
Keyboardio.setup (KEYMAP_SIZE); Kaleidoscope.setup (KEYMAP_SIZE);
Keyboardio.use (&TapDance, NULL); Kaleidoscope.use (&TapDance, NULL);
} }
void loop () { void loop () {
Keyboardio.loop (); Kaleidoscope.loop ();
} }

@ -1,10 +1,10 @@
name=Akela-TapDance name=Kaleidoscope-TapDance
version=0.0.0 version=0.0.0
author=Gergely Nagy author=Gergely Nagy
maintainer=Gergely Nagy <akela@gergo.csillger.hu> maintainer=Gergely Nagy <kaleidoscope@gergo.csillger.hu>
sentence=Tap-dance keys for Keyboardio boards. sentence=Tap-dance keys for Kaleidoscope.
paragraph=Generic, multi-use keys. paragraph=Generic, multi-use keys.
category=Communication category=Communication
url=https://github.com/keyboardio/Akela-TapDance url=https://github.com/keyboardio/Kaleidoscope-TapDance
architectures=avr architectures=avr
dot_a_linkage=true dot_a_linkage=true

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* Akela -- Animated Keyboardio Extension Library for Anything * Kaleidoscope-TapDance -- Tap-dance keys
* Copyright (C) 2016, 2017 Gergely Nagy * Copyright (C) 2016, 2017 Gergely Nagy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -18,4 +18,4 @@
#pragma once #pragma once
#include <Akela/TapDance.h> #include <Kaleidoscope/TapDance.h>

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* Akela -- Animated Keyboardio Extension Library for Anything * Kaleidoscope-TapDance -- Tap-dance keys
* Copyright (C) 2016, 2017 Gergely Nagy * Copyright (C) 2016, 2017 Gergely Nagy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -16,11 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <Akela-TapDance.h> #include <Kaleidoscope-TapDance.h>
using namespace Akela::Ranges; using namespace KaleidoscopePlugins::Ranges;
namespace Akela { namespace KaleidoscopePlugins {
// --- state --- // --- state ---
uint32_t TapDance::startTime; uint32_t TapDance::startTime;
uint16_t TapDance::timeOut = 200; uint16_t TapDance::timeOut = 200;
@ -220,7 +220,7 @@ namespace Akela {
__attribute__((weak)) __attribute__((weak))
void void
tapDanceAction (uint8_t tapDanceIndex, byte row, byte col, uint8_t tapCount, Akela::TapDance::ActionType tapDanceAction) { tapDanceAction (uint8_t tapDanceIndex, byte row, byte col, uint8_t tapCount, KaleidoscopePlugins::TapDance::ActionType tapDanceAction) {
} }
Akela::TapDance TapDance; KaleidoscopePlugins::TapDance TapDance;

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* Akela -- Animated Keyboardio Extension Library for Anything * Kaleidoscope-TapDance -- Tap-dance keys
* Copyright (C) 2016, 2017 Gergely Nagy * Copyright (C) 2016, 2017 Gergely Nagy
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -18,9 +18,10 @@
#pragma once #pragma once
#include <Akela-Core.h> #include <Kaleidoscope.h>
#include <Kaleidoscope-Ranges.h>
#define TD(n) (Key){.raw = Akela::Ranges::TD_FIRST + n } #define TD(n) (Key){.raw = KaleidoscopePlugins::Ranges::TD_FIRST + n }
#define tapDanceActionKeys(tapCount, tapDanceAction, ...) ({ \ #define tapDanceActionKeys(tapCount, tapDanceAction, ...) ({ \
static const Key __k[] PROGMEM = { __VA_ARGS__ }; \ static const Key __k[] PROGMEM = { __VA_ARGS__ }; \
@ -28,8 +29,8 @@
sizeof (__k) / sizeof (Key), &__k[0]); \ sizeof (__k) / sizeof (Key), &__k[0]); \
}) })
namespace Akela { namespace KaleidoscopePlugins {
class TapDance : public KeyboardioPlugin { class TapDance : public KaleidoscopePlugin {
public: public:
typedef enum { typedef enum {
Tap, Tap,
@ -65,6 +66,6 @@ namespace Akela {
}; };
}; };
void tapDanceAction (uint8_t tapDanceIndex, byte row, byte col, uint8_t tapCount, Akela::TapDance::ActionType tapDanceAction); void tapDanceAction (uint8_t tapDanceIndex, byte row, byte col, uint8_t tapCount, KaleidoscopePlugins::TapDance::ActionType tapDanceAction);
extern Akela::TapDance TapDance; extern KaleidoscopePlugins::TapDance TapDance;
Loading…
Cancel
Save