diff --git a/examples/EEPROM-Keymap/EEPROM-Keymap.ino b/examples/EEPROM-Keymap/EEPROM-Keymap.ino index 30d39015..b2d8be40 100644 --- a/examples/EEPROM-Keymap/EEPROM-Keymap.ino +++ b/examples/EEPROM-Keymap/EEPROM-Keymap.ino @@ -54,9 +54,9 @@ void setup () { Focus.addHook (FOCUS_HOOK_HELP); Focus.addHook (FOCUS_HOOK_VERSION); - Layer.getKey = EEPROMKeymap.getKey; + Layer.getKey = EEPROMKeymap.getKeyOverride; - EEPROMKeymap.reserveSpace (2); + EEPROMKeymap.reserveSpace (1); EEPROMSettings.seal (); } diff --git a/src/Kaleidoscope/EEPROM-Keymap.cpp b/src/Kaleidoscope/EEPROM-Keymap.cpp index 126c0e77..2e095fff 100644 --- a/src/Kaleidoscope/EEPROM-Keymap.cpp +++ b/src/Kaleidoscope/EEPROM-Keymap.cpp @@ -53,6 +53,16 @@ namespace KaleidoscopePlugins { return key; } + Key + EEPROMKeymap::getKeyOverride (uint8_t layer, byte row, byte col) { + Key key; + + key = getKey (layer, row, col); + if (key == Key_Transparent) + key = Layer.getKeyFromPROGMEM (layer, row, col); + return key; + } + uint16_t EEPROMKeymap::base (void) { return keymapBase; diff --git a/src/Kaleidoscope/EEPROM-Keymap.h b/src/Kaleidoscope/EEPROM-Keymap.h index f9995d71..65574d23 100644 --- a/src/Kaleidoscope/EEPROM-Keymap.h +++ b/src/Kaleidoscope/EEPROM-Keymap.h @@ -32,6 +32,7 @@ namespace KaleidoscopePlugins { static uint16_t base (void); static Key getKey (uint8_t layer, byte row, byte col); + static Key getKeyOverride (uint8_t layer, byte row, byte col); static bool focusKeymap (const char *command); static bool focusKeymapTransfer (const char *command);