Add an .activate() method

To make things friendlier to the end-user, add an `.activate()` alias to
`.nextState()`, and document that.

Fixes #3.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 101da6450f
commit 6b2263cfa7

@ -67,7 +67,7 @@ to use a macro, as in the example below:
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
if (macroIndex == 0 && key_toggled_off(keyState)) {
EEPROMKeymapProgrammer.nextState();
EEPROMKeymapProgrammer.activate();
}
return MACRO_NONE;
@ -93,11 +93,10 @@ take over.
The plugin provides the `EEPROMKeymapProgrammer` object, which has the following methods:
### `.nextState()`
### `.activate()`
> Puts the programmer into the next appropriate state. When the programmer is
> inactive, this activates it. One usually does not have to call this function
> in any other case.
> Activates the keymap programmer. This is the function one needs to call from -
> say - a macro, to enter the edit state.
### `.mode`

@ -43,7 +43,7 @@ const Key keymaps[][ROWS][COLS] PROGMEM = {
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
if (macroIndex == 0 && key_toggled_off(keyState)) {
EEPROMKeymapProgrammer.nextState();
EEPROMKeymapProgrammer.activate();
}
return MACRO_NONE;

@ -34,6 +34,7 @@ class EEPROMKeymapProgrammer : public KaleidoscopePlugin {
void begin(void) final;
static void activate(void) { nextState(); }
static void nextState(void);
static void cancel(void);

Loading…
Cancel
Save