From f916c2c0d49192942ae72d19a122dbeac174b42f Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 17 Jun 2021 02:06:48 +0200 Subject: [PATCH 1/4] CharShift: Transition to using a function pointer instead of overridables Instead of using overridable functions, use function pointers (+ setters) to allow changing lookups and related things. This allows a bit more flexibility, and makes the user sketch simpler, because there is no override necessary there. Signed-off-by: Gergely Nagy --- .../src/kaleidoscope/plugin/CharShift.cpp | 20 +++++---------- .../src/kaleidoscope/plugin/CharShift.h | 25 ++++++++++--------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp index dd4539912f..a193c59698 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp @@ -34,6 +34,10 @@ namespace plugin { // CharShift class variables CharShift::KeyPair const * CharShift::progmem_keypairs_{nullptr}; uint8_t CharShift::num_keypairs_{0}; +CharShift::GetNumKeyPairsFunction CharShift::numKeyPairs_ = + CharShift::numProgmemKeyPairs; +CharShift::ReadKeyPairFunction CharShift::readKeyPair_ = + CharShift::readKeyPairFromProgmem; bool CharShift::reverse_shift_state_{false}; @@ -117,24 +121,12 @@ bool CharShift::isCharShiftKey(Key key) { CharShift::KeyPair CharShift::decodeCharShiftKey(Key key) { uint8_t i = key.getRaw() - ranges::CS_FIRST; - if (i < numKeyPairs()) { - return readKeyPair(i); + if (i < numKeyPairs_()) { + return readKeyPair_(i); } return {Key_NoKey, Key_NoKey}; } -// This should be overridden if the KeyPairs array is stored in EEPROM -__attribute__((weak)) -uint8_t CharShift::numKeyPairs() { - return numProgmemKeyPairs(); -} - -// This should be overridden if the KeyPairs array is stored in EEPROM -__attribute__((weak)) -CharShift::KeyPair CharShift::readKeyPair(uint8_t n) { - return readKeyPairFromProgmem(n); -} - uint8_t CharShift::numProgmemKeyPairs() { return num_keypairs_; } diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h index f2ace27a6c..293f88fd51 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h @@ -76,12 +76,25 @@ class CharShift : public Plugin { num_keypairs_ = _num_keypairs; } + typedef uint8_t (*GetNumKeyPairsFunction)(); + typedef KeyPair (*ReadKeyPairFunction)(uint8_t n); + + static void setNumKeyPairsFunction(GetNumKeyPairsFunction f) { + numKeyPairs_ = f; + } + static void setReadKeyPairFunction(ReadKeyPairFunction f) { + readKeyPair_ = f; + } + private: // A pointer to an array of `KeyPair` objects in PROGMEM static KeyPair const * progmem_keypairs_; // The size of the PROGMEM array of `KeyPair` objects static uint8_t num_keypairs_; + static GetNumKeyPairsFunction numKeyPairs_; + static ReadKeyPairFunction readKeyPair_; + // If a `shift` key needs to be suppressed in `beforeReportingState()` static bool reverse_shift_state_; @@ -91,18 +104,6 @@ class CharShift : public Plugin { /// Look up the `KeyPair` specified by the given keymap entry static KeyPair decodeCharShiftKey(Key key); - /// Get the total number of KeyPairs defined - /// - /// This function can be overridden in order to store the `KeyPair` array in - /// EEPROM instead of PROGMEM. - static uint8_t numKeyPairs(); - - /// Get the `KeyPair` at the specified index from the defined `KeyPair` array - /// - /// This function can be overridden in order to store the `KeyPair` array in - /// EEPROM instead of PROGMEM. - static KeyPair readKeyPair(uint8_t n); - // Default for `keypairsCount()`: size of the PROGMEM array static uint8_t numProgmemKeyPairs(); // Default for `readKeypair(i)`: fetch the value from PROGMEM From 7d6ce8bf45fa97702f41f5fa6a0fdede6196c5b0 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 17 Jun 2021 02:33:05 +0200 Subject: [PATCH 2/4] CharShift: WIP CharShiftConfig Signed-off-by: Gergely Nagy --- .../src/kaleidoscope/plugin/CharShift.h | 26 +++++ .../kaleidoscope/plugin/CharShiftConfig.cpp | 110 ++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftConfig.cpp diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h index 293f88fd51..2a34da2555 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h @@ -86,6 +86,8 @@ class CharShift : public Plugin { readKeyPair_ = f; } + friend class CharShiftConfig; + private: // A pointer to an array of `KeyPair` objects in PROGMEM static KeyPair const * progmem_keypairs_; @@ -110,10 +112,34 @@ class CharShift : public Plugin { static KeyPair readKeyPairFromProgmem(uint8_t n); }; +class CharShiftConfig: public Plugin { + public: + CharShiftConfig() {} + + EventHandlerResult onNameQuery(); + EventHandlerResult onFocusEvent(const char *command); + + static void setup(uint8_t dynamic_offset, uint8_t max_pairs); + + private: + static uint8_t max_pairs_; + static uint16_t storage_base_; + static uint8_t dynamic_offset_; + + static uint8_t numEEPROMPairs() { + return max_pairs_; + } + static CharShift::KeyPair readKeyPairFromEEPROM(uint8_t n); + + static uint8_t numPairs(); + static CharShift::KeyPair readKeyPair(uint8_t n); +}; + } // namespace plugin } // namespace kaleidoscope extern kaleidoscope::plugin::CharShift CharShift; +extern kaleidoscope::plugin::CharShiftConfig CharShiftConfig; /// Define an array of `KeyPair` objects in PROGMEM /// diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftConfig.cpp b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftConfig.cpp new file mode 100644 index 0000000000..7fc849eaf8 --- /dev/null +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftConfig.cpp @@ -0,0 +1,110 @@ +/* -*- mode: c++ -*- + * Kaleidoscope-CharShift -- Independently assign shifted and unshifted symbols + * Copyright (C) 2021 Keyboard.io, Inc + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#include "kaleidoscope/plugin/CharShift.h" + +#include +#include + +#include "kaleidoscope/Runtime.h" + +namespace kaleidoscope { +namespace plugin { + +// ============================================================================= +// CharShiftConfig class variables + +uint8_t CharShiftConfig::max_pairs_; +uint8_t CharShiftConfig::dynamic_offset_; +uint16_t CharShiftConfig::storage_base_; + +// ============================================================================= +// Event handlers + +EventHandlerResult CharShiftConfig::onNameQuery() { + return ::Focus.sendName(F("CharShiftConfig")); +} + +EventHandlerResult CharShiftConfig::onFocusEvent(const char *command) { + if (::Focus.handleHelp(command, PSTR("charshift.map"))) + return EventHandlerResult::OK; + + if (strcmp_P(command, PSTR("charshift.map")) != 0) + return EventHandlerResult::OK; + + if (::Focus.isEOL()) { + // We dump key by key, rather than pairs, because the end result is the + // same, and dumping one by one is less code. + for (uint16_t i = 0; i < max_pairs_ * 2; i += 2) { + Key k; + + Runtime.storage().get(storage_base_ + i, k); + ::Focus.send(k); + } + } else { + uint16_t pos = 0; + + // We read one key at a time, rather than a keypair, to better handle + // partials and failure, and to make the code simpler. + while (!::Focus.isEOL()) { + Key k; + + ::Focus.read(k); + Runtime.storage().put(storage_base_ + pos, k); + pos += 2; + } + Runtime.storage().commit(); + } + + return EventHandlerResult::EVENT_CONSUMED; +} + +// ============================================================================= +// Support functions + +void CharShiftConfig::setup(uint8_t dynamic_offset, uint8_t max_pairs) { + dynamic_offset_ = dynamic_offset; + max_pairs_ = max_pairs; + + storage_base_ = ::EEPROMSettings.requestSlice(max_pairs * 4); + ::CharShift.setNumKeyPairsFunction(numPairs); + ::CharShift.setReadKeyPairFunction(readKeyPair); +} + +CharShift::KeyPair CharShiftConfig::readKeyPairFromEEPROM(uint8_t n) { + uint16_t pos = storage_base_ + n * 4; // 4: Size of a keypair. + uint16_t raw_lower = Runtime.storage().read(pos); + uint16_t raw_upper = Runtime.storage().read(pos + 2); + + return CharShift::KeyPair(Key(raw_lower), Key(raw_upper)); +} + +uint8_t CharShiftConfig::numPairs() { + return CharShift::numProgmemKeyPairs() + numEEPROMPairs(); +} + +CharShift::KeyPair CharShiftConfig::readKeyPair(uint8_t n) { + if (n < dynamic_offset_) { + return CharShift::readKeyPairFromProgmem(n); + } + return readKeyPairFromEEPROM(n - dynamic_offset_); +} + +} // namespace plugin +} // namespace kaleidoscope + +kaleidoscope::plugin::CharShiftConfig CharShiftConfig; From ee36ed6929a626f0f7fd5ff82c25d830eaacbd20 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 17 Jun 2021 18:42:07 +0200 Subject: [PATCH 3/4] CharShift: Migrate to a pluggable storage sub-class Signed-off-by: Gergely Nagy --- .../src/kaleidoscope/plugin/CharShift.cpp | 27 ++--- .../src/kaleidoscope/plugin/CharShift.h | 107 ++++++++++-------- ...arShiftConfig.cpp => CharShiftStorage.cpp} | 55 +++++---- 3 files changed, 94 insertions(+), 95 deletions(-) rename plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/{CharShiftConfig.cpp => CharShiftStorage.cpp} (66%) diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp index a193c59698..a614debbac 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp @@ -32,20 +32,21 @@ namespace plugin { // ============================================================================= // CharShift class variables -CharShift::KeyPair const * CharShift::progmem_keypairs_{nullptr}; -uint8_t CharShift::num_keypairs_{0}; -CharShift::GetNumKeyPairsFunction CharShift::numKeyPairs_ = - CharShift::numProgmemKeyPairs; -CharShift::ReadKeyPairFunction CharShift::readKeyPair_ = - CharShift::readKeyPairFromProgmem; - +charshift::Storage * CharShift::storage_; bool CharShift::reverse_shift_state_{false}; +static auto progmem_storage_ = charshift::ProgmemStorage(); // ============================================================================= // Event handlers // ----------------------------------------------------------------------------- +EventHandlerResult CharShift::onSetup() { + if (!storage_) { + storage_ = &progmem_storage_; + } + return EventHandlerResult::OK; +} EventHandlerResult CharShift::onNameQuery() { return ::Focus.sendName(F("CharShift")); } @@ -121,20 +122,12 @@ bool CharShift::isCharShiftKey(Key key) { CharShift::KeyPair CharShift::decodeCharShiftKey(Key key) { uint8_t i = key.getRaw() - ranges::CS_FIRST; - if (i < numKeyPairs_()) { - return readKeyPair_(i); + if (i < storage_->numKeyPairs()) { + return storage_->readKeyPair(i); } return {Key_NoKey, Key_NoKey}; } -uint8_t CharShift::numProgmemKeyPairs() { - return num_keypairs_; -} - -CharShift::KeyPair CharShift::readKeyPairFromProgmem(uint8_t n) { - return cloneFromProgmem(progmem_keypairs_[n]); -} - } // namespace plugin } // namespace kaleidoscope diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h index 2a34da2555..5660e25b9b 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.h @@ -24,6 +24,10 @@ namespace kaleidoscope { namespace plugin { +namespace charshift { +class Storage; +} + // ============================================================================= /// Kaleidoscope plugin for independently assigning shifted symbols /// @@ -36,9 +40,11 @@ namespace plugin { class CharShift : public Plugin { public: + EventHandlerResult onSetup(); EventHandlerResult onNameQuery(); EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult beforeReportingState(const KeyEvent &event); + EventHandlerResult onFocusEvent(const char *command); // --------------------------------------------------------------------------- /// A structure that stores CharShift key pair values @@ -63,39 +69,15 @@ class CharShift : public Plugin { KeyPair() = default; }; - /// Configure the KeyPairs array in PROGMEM - /// - /// This function configures the PROGMEM array of `KeyPair` objects, - /// automatically setting the internal count variable from the size of the - /// `keypairs` array given, which must be a fixed-sized array, not a pointer. - /// Generally, it will be called via the `KEYPAIRS()` preprocessor macro, not - /// directly by user code. - template - static void setProgmemKeyPairs(KeyPair const(&keypairs)[_num_keypairs]) { - progmem_keypairs_ = keypairs; - num_keypairs_ = _num_keypairs; + charshift::Storage &storage() { + return *storage_; } - - typedef uint8_t (*GetNumKeyPairsFunction)(); - typedef KeyPair (*ReadKeyPairFunction)(uint8_t n); - - static void setNumKeyPairsFunction(GetNumKeyPairsFunction f) { - numKeyPairs_ = f; + void setStorage(charshift::Storage *st) { + storage_ = st; } - static void setReadKeyPairFunction(ReadKeyPairFunction f) { - readKeyPair_ = f; - } - - friend class CharShiftConfig; private: - // A pointer to an array of `KeyPair` objects in PROGMEM - static KeyPair const * progmem_keypairs_; - // The size of the PROGMEM array of `KeyPair` objects - static uint8_t num_keypairs_; - - static GetNumKeyPairsFunction numKeyPairs_; - static ReadKeyPairFunction readKeyPair_; + static charshift::Storage *storage_; // If a `shift` key needs to be suppressed in `beforeReportingState()` static bool reverse_shift_state_; @@ -105,41 +87,68 @@ class CharShift : public Plugin { /// Look up the `KeyPair` specified by the given keymap entry static KeyPair decodeCharShiftKey(Key key); - - // Default for `keypairsCount()`: size of the PROGMEM array - static uint8_t numProgmemKeyPairs(); - // Default for `readKeypair(i)`: fetch the value from PROGMEM - static KeyPair readKeyPairFromProgmem(uint8_t n); }; -class CharShiftConfig: public Plugin { +namespace charshift { + +class Storage { public: - CharShiftConfig() {} + Storage() {} - EventHandlerResult onNameQuery(); - EventHandlerResult onFocusEvent(const char *command); + static uint8_t numKeyPairs() { + return num_keypairs_; + } + static CharShift::KeyPair readKeyPair(uint8_t n) { + return CharShift::KeyPair(Key_NoKey, Key_NoKey); + } - static void setup(uint8_t dynamic_offset, uint8_t max_pairs); + EventHandlerResult onFocusEvent(const char *command) { + return EventHandlerResult::OK; + } - private: - static uint8_t max_pairs_; - static uint16_t storage_base_; - static uint8_t dynamic_offset_; + protected: + static uint8_t num_keypairs_; +}; + +class ProgmemStorage: public Storage { + public: + + static CharShift::KeyPair readKeyPair(uint8_t n); - static uint8_t numEEPROMPairs() { - return max_pairs_; + /// Configure the KeyPairs array in PROGMEM + /// + /// This function configures the PROGMEM array of `KeyPair` objects, + /// automatically setting the internal count variable from the size of the + /// `keypairs` array given, which must be a fixed-sized array, not a pointer. + /// Generally, it will be called via the `KEYPAIRS()` preprocessor macro, not + /// directly by user code. + template + static void setKeyPairs(CharShift::KeyPair const(&keypairs)[_num_keypairs]) { + keypairs_ = keypairs; + num_keypairs_ = _num_keypairs; } - static CharShift::KeyPair readKeyPairFromEEPROM(uint8_t n); - static uint8_t numPairs(); + private: + // A pointer to an array of `KeyPair` objects in PROGMEM + static CharShift::KeyPair const *keypairs_; +}; + +class EEPROMStorage: public Storage { + public: + void setup(uint8_t num_pairs); static CharShift::KeyPair readKeyPair(uint8_t n); + + EventHandlerResult onFocusEvent(const char *command); + private: + static uint16_t storage_base_; }; +} + } // namespace plugin } // namespace kaleidoscope extern kaleidoscope::plugin::CharShift CharShift; -extern kaleidoscope::plugin::CharShiftConfig CharShiftConfig; /// Define an array of `KeyPair` objects in PROGMEM /// @@ -151,7 +160,7 @@ extern kaleidoscope::plugin::CharShiftConfig CharShiftConfig; static kaleidoscope::plugin::CharShift::KeyPair const kp_table[] PROGMEM = { \ keypairs \ }; \ - CharShift.setProgmemKeyPairs(kp_table); \ + CharShift.storage().setKeyPairs(kp_table); \ } /// Define an `KeyPair` entry in a keymap diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftConfig.cpp b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftStorage.cpp similarity index 66% rename from plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftConfig.cpp rename to plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftStorage.cpp index 7fc849eaf8..ffcbd60cd8 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftConfig.cpp +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShiftStorage.cpp @@ -17,29 +17,42 @@ #include "kaleidoscope/plugin/CharShift.h" +#include #include #include +#include "kaleidoscope/KeyAddr.h" +#include "kaleidoscope/key_defs.h" +#include "kaleidoscope/KeyEvent.h" +#include "kaleidoscope/keyswitch_state.h" +#include "kaleidoscope/progmem_helpers.h" #include "kaleidoscope/Runtime.h" namespace kaleidoscope { namespace plugin { +namespace charshift { // ============================================================================= -// CharShiftConfig class variables +// Storage class variables + +uint8_t Storage::num_keypairs_; + +CharShift::KeyPair const * ProgmemStorage::keypairs_{nullptr}; + +uint16_t EEPROMStorage::storage_base_; -uint8_t CharShiftConfig::max_pairs_; -uint8_t CharShiftConfig::dynamic_offset_; -uint16_t CharShiftConfig::storage_base_; // ============================================================================= -// Event handlers +// Progmem Storage -EventHandlerResult CharShiftConfig::onNameQuery() { - return ::Focus.sendName(F("CharShiftConfig")); +CharShift::KeyPair ProgmemStorage::readKeyPair(uint8_t n) { + return cloneFromProgmem(keypairs_[n]); } -EventHandlerResult CharShiftConfig::onFocusEvent(const char *command) { + +// ============================================================================= +// EEPROM Storage +EventHandlerResult EEPROMStorage::onFocusEvent(const char *command) { if (::Focus.handleHelp(command, PSTR("charshift.map"))) return EventHandlerResult::OK; @@ -49,7 +62,7 @@ EventHandlerResult CharShiftConfig::onFocusEvent(const char *command) { if (::Focus.isEOL()) { // We dump key by key, rather than pairs, because the end result is the // same, and dumping one by one is less code. - for (uint16_t i = 0; i < max_pairs_ * 2; i += 2) { + for (uint16_t i = 0; i < num_keypairs_ * 2; i += 2) { Key k; Runtime.storage().get(storage_base_ + i, k); @@ -73,19 +86,13 @@ EventHandlerResult CharShiftConfig::onFocusEvent(const char *command) { return EventHandlerResult::EVENT_CONSUMED; } -// ============================================================================= -// Support functions - -void CharShiftConfig::setup(uint8_t dynamic_offset, uint8_t max_pairs) { - dynamic_offset_ = dynamic_offset; - max_pairs_ = max_pairs; +void EEPROMStorage::setup(uint8_t num_keypairs) { + num_keypairs_ = num_keypairs; - storage_base_ = ::EEPROMSettings.requestSlice(max_pairs * 4); - ::CharShift.setNumKeyPairsFunction(numPairs); - ::CharShift.setReadKeyPairFunction(readKeyPair); + storage_base_ = ::EEPROMSettings.requestSlice(num_keypairs * 4); } -CharShift::KeyPair CharShiftConfig::readKeyPairFromEEPROM(uint8_t n) { +CharShift::KeyPair EEPROMStorage::readKeyPair(uint8_t n) { uint16_t pos = storage_base_ + n * 4; // 4: Size of a keypair. uint16_t raw_lower = Runtime.storage().read(pos); uint16_t raw_upper = Runtime.storage().read(pos + 2); @@ -93,18 +100,8 @@ CharShift::KeyPair CharShiftConfig::readKeyPairFromEEPROM(uint8_t n) { return CharShift::KeyPair(Key(raw_lower), Key(raw_upper)); } -uint8_t CharShiftConfig::numPairs() { - return CharShift::numProgmemKeyPairs() + numEEPROMPairs(); } -CharShift::KeyPair CharShiftConfig::readKeyPair(uint8_t n) { - if (n < dynamic_offset_) { - return CharShift::readKeyPairFromProgmem(n); - } - return readKeyPairFromEEPROM(n - dynamic_offset_); -} } // namespace plugin } // namespace kaleidoscope - -kaleidoscope::plugin::CharShiftConfig CharShiftConfig; From 0cc060e4a498d9d18f4190fa436071f0bf54f14b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 17 Jun 2021 18:47:43 +0200 Subject: [PATCH 4/4] wip: focus fix Signed-off-by: Gergely Nagy --- .../src/kaleidoscope/plugin/CharShift.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp index a614debbac..e7e5ad94cb 100644 --- a/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp +++ b/plugins/Kaleidoscope-CharShift/src/kaleidoscope/plugin/CharShift.cpp @@ -50,6 +50,9 @@ EventHandlerResult CharShift::onSetup() { EventHandlerResult CharShift::onNameQuery() { return ::Focus.sendName(F("CharShift")); } +EventHandlerResult CharShift::onFocusEvent(const char *command) { + return storage_->onFocusEvent(command); +} // ----------------------------------------------------------------------------- EventHandlerResult CharShift::onKeyEvent(KeyEvent &event) {