From 03ab5f1a474cfabf8303e0fbb70900039c3c4a11 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 26 Feb 2017 09:04:13 +0100 Subject: [PATCH] Updated to support newest Focus Signed-off-by: Gergely Nagy --- examples/EEPROM-Keymap/EEPROM-Keymap.ino | 5 +++- src/Kaleidoscope/EEPROM-Keymap.h | 38 ++++++++++++------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/examples/EEPROM-Keymap/EEPROM-Keymap.ino b/examples/EEPROM-Keymap/EEPROM-Keymap.ino index e1f1a470..9bdd3656 100644 --- a/examples/EEPROM-Keymap/EEPROM-Keymap.ino +++ b/examples/EEPROM-Keymap/EEPROM-Keymap.ino @@ -48,7 +48,10 @@ void setup () { USE_PLUGINS (&EEPROMKeymap, &Focus); - Focus.addCommand (FOCUS_CMD_KEYMAP); + Focus.addHook (FOCUS_HOOK_KEYMAP); + Focus.addHook (FOCUS_HOOK_HELP); + Focus.addHook (FOCUS_HOOK_VERSION); + Layer.getKey = EEPROMKeymap.getKey; } diff --git a/src/Kaleidoscope/EEPROM-Keymap.h b/src/Kaleidoscope/EEPROM-Keymap.h index e80b6cb0..65a77cd4 100644 --- a/src/Kaleidoscope/EEPROM-Keymap.h +++ b/src/Kaleidoscope/EEPROM-Keymap.h @@ -19,25 +19,25 @@ #include #include -#define FOCUS_CMD_KEYMAP FOCUS_COMMAND(EEPROMKeymap.focusKeymap, \ - "keymap.dump\n" \ - "-----------\n" \ - "Dumps the keymap from EEPROM.\n\n" \ - "keymap.upload ...\n" \ - "-------------------------------\n" \ - "Uploads a new keymap to EEPROM." \ - "Starts at layer 0, row 0, column 0, " \ - "and continues as long as there is data on the line.\n\n" \ - "keymap.setPos layer row column flag keyCode\n" \ - "-------------------------------------------\n" \ - "Sets the key at the specified `layer`, `row`, and `column` " \ - "to the key with `flag`, and `keyCode` properties.\n\n" \ - "keymap.getPos layer row column\n" \ - "------------------------------\n" \ - "Dump the key at `layer`, `row`, and `column`.\n\n" \ - "keymap.transfer layer\n" \ - "---------------------\n" \ - "Transfers the `layer` from PROGMEM to EEPROM.") +#define FOCUS_HOOK_KEYMAP FOCUS_HOOK(EEPROMKeymap.focusKeymap, \ + "keymap.dump\n" \ + "-----------\n" \ + "Dumps the keymap from EEPROM.\n\n" \ + "keymap.upload ...\n" \ + "-------------------------------\n" \ + "Uploads a new keymap to EEPROM." \ + "Starts at layer 0, row 0, column 0, " \ + "and continues as long as there is data on the line.\n\n" \ + "keymap.setPos layer row column flag keyCode\n" \ + "-------------------------------------------\n" \ + "Sets the key at the specified `layer`, `row`, and `column` " \ + "to the key with `flag`, and `keyCode` properties.\n\n" \ + "keymap.getPos layer row column\n" \ + "------------------------------\n" \ + "Dump the key at `layer`, `row`, and `column`.\n\n" \ + "keymap.transfer layer\n" \ + "---------------------\n" \ + "Transfers the `layer` from PROGMEM to EEPROM.") namespace KaleidoscopePlugins { class EEPROMKeymap : public KaleidoscopePlugin {