|
|
@ -1,4 +1,4 @@
|
|
|
|
# Akela-Syster
|
|
|
|
# Kaleidoscope-Syster
|
|
|
|
|
|
|
|
|
|
|
|
![status][st:experimental]
|
|
|
|
![status][st:experimental]
|
|
|
|
|
|
|
|
|
|
|
@ -21,21 +21,22 @@ To use the plugin, one needs to include the header, and set up a function that
|
|
|
|
will handle the symbol actions:
|
|
|
|
will handle the symbol actions:
|
|
|
|
|
|
|
|
|
|
|
|
```c++
|
|
|
|
```c++
|
|
|
|
#include <Akela-Syster.h>
|
|
|
|
#include <Kaleidoscope.h>
|
|
|
|
#include <Akela-Unicode.h>
|
|
|
|
#include <Kaleidoscope-Syster.h>
|
|
|
|
|
|
|
|
#include <Kaleidoscope-Unicode.h>
|
|
|
|
|
|
|
|
|
|
|
|
void systerAction (Akela::Syster::action_t action, const char *symbol) {
|
|
|
|
void systerAction (KaleidoscopePlugins::Syster::action_t action, const char *symbol) {
|
|
|
|
switch (action) {
|
|
|
|
switch (action) {
|
|
|
|
case Akela::Syster::StartAction:
|
|
|
|
case KaleidoscopePlugins::Syster::StartAction:
|
|
|
|
Unicode.type (0x2328);
|
|
|
|
Unicode.type (0x2328);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Akela::Syster::EndAction:
|
|
|
|
case KaleidoscopePlugins::Syster::EndAction:
|
|
|
|
handle_key_event (Key_Backspace, 255, 255, IS_PRESSED | INJECTED);
|
|
|
|
handle_key_event (Key_Backspace, 255, 255, IS_PRESSED | INJECTED);
|
|
|
|
Keyboard.sendReport ();
|
|
|
|
Keyboard.sendReport ();
|
|
|
|
handle_key_event (Key_Backspace, 255, 255, WAS_PRESSED | INJECTED);
|
|
|
|
handle_key_event (Key_Backspace, 255, 255, WAS_PRESSED | INJECTED);
|
|
|
|
Keyboard.sendReport ();
|
|
|
|
Keyboard.sendReport ();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Akela::Syster::SymbolAction:
|
|
|
|
case KaleidoscopePlugins::Syster::SymbolAction:
|
|
|
|
Serial.print ("systerAction: symbol=");
|
|
|
|
Serial.print ("systerAction: symbol=");
|
|
|
|
Serial.println (symbol);
|
|
|
|
Serial.println (symbol);
|
|
|
|
if (strcmp (symbol, "coffee") == 0) {
|
|
|
|
if (strcmp (symbol, "coffee") == 0) {
|
|
|
@ -48,8 +49,8 @@ void systerAction (Akela::Syster::action_t action, const char *symbol) {
|
|
|
|
void setup () {
|
|
|
|
void setup () {
|
|
|
|
Serial.begin (9600);
|
|
|
|
Serial.begin (9600);
|
|
|
|
|
|
|
|
|
|
|
|
Keyboardio.setup (KEYMAP_SIZE);
|
|
|
|
Kaleidoscope.setup (KEYMAP_SIZE);
|
|
|
|
Keyboardio.use (&Unicode, &Syster, NULL);
|
|
|
|
Kaleidoscope.use (&Unicode, &Syster, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
@ -66,18 +67,20 @@ methods outside of the object, however, that can be overridden:
|
|
|
|
> Called whenever an action needs to be taken, which can happen in three cases:
|
|
|
|
> Called whenever an action needs to be taken, which can happen in three cases:
|
|
|
|
|
|
|
|
|
|
|
|
> First, when the `Syster` key is pressed, and the alternate processing starts.
|
|
|
|
> First, when the `Syster` key is pressed, and the alternate processing starts.
|
|
|
|
> In this case, `action` will be set to `Akela::Syster::StartAction`, and
|
|
|
|
> In this case, `action` will be set to
|
|
|
|
> `symbol` will be `NULL`. This function can be used to do some setup to make it
|
|
|
|
> `KaleidoscopePlugins::Syster::StartAction`, and `symbol` will be `NULL`. This
|
|
|
|
> more obvious that the Syster input mode is active, such as sending a Unicode
|
|
|
|
> function can be used to do some setup to make it more obvious that the Syster
|
|
|
|
> symbol to the host, or lighting up LEDs, or anything else we'd like.
|
|
|
|
> input mode is active, such as sending a Unicode symbol to the host, or
|
|
|
|
|
|
|
|
> lighting up LEDs, or anything else we'd like.
|
|
|
|
>
|
|
|
|
>
|
|
|
|
> Second, when the sequence is finished with a `Space`. In this case, `action`
|
|
|
|
> Second, when the sequence is finished with a `Space`. In this case, `action`
|
|
|
|
> will be set to `Akela::Syster::EndAction`, and `symbol` will be `NULL`. This
|
|
|
|
> will be set to `KaleidoscopePlugins::Syster::EndAction`, and `symbol` will be
|
|
|
|
> can be used to undo anything that the start action did, if need be.
|
|
|
|
> `NULL`. This can be used to undo anything that the start action did, if need
|
|
|
|
|
|
|
|
> be.
|
|
|
|
>
|
|
|
|
>
|
|
|
|
> Third, when the action for the symbol should be made. In this case, `action`
|
|
|
|
> Third, when the action for the symbol should be made. In this case, `action`
|
|
|
|
> is set to `Akela::Syster::SymbolAction`, and `symbol` will be a C string. It
|
|
|
|
> is set to `KaleidoscopePlugins::Syster::SymbolAction`, and `symbol` will be a
|
|
|
|
> is up to us, what we do with this information, how we handle it.
|
|
|
|
> C string. It is up to us, what we do with this information, how we handle it.
|
|
|
|
|
|
|
|
|
|
|
|
### `keyToChar(key)`
|
|
|
|
### `keyToChar(key)`
|
|
|
|
|
|
|
|
|
|
|
@ -90,4 +93,4 @@ methods outside of the object, however, that can be overridden:
|
|
|
|
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-Syster/blob/master/examples/Syster/Syster.ino
|
|
|
|
[plugin:example]: https://github.com/keyboardio/Kaleidoscope-Syster/blob/master/examples/Syster/Syster.ino
|
|
|
|