|
|
@ -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
|
|
|
|