diff --git a/src/kaleidoscope/plugin/Redial.cpp b/src/kaleidoscope/plugin/Redial.cpp index 5b2e0263..886d8d70 100644 --- a/src/kaleidoscope/plugin/Redial.cpp +++ b/src/kaleidoscope/plugin/Redial.cpp @@ -21,27 +21,16 @@ namespace kaleidoscope { namespace plugin { -Key Redial::key_to_redial_; Key Redial::last_key_; -bool Redial::redial_held_ = false; EventHandlerResult Redial::onKeyswitchEvent(Key &mapped_key, KeyAddr key_addr, uint8_t key_state) { - if (mapped_key == Key_Redial) { - if (keyToggledOff(key_state)) - key_to_redial_ = last_key_; - - mapped_key = key_to_redial_; - redial_held_ = keyIsPressed(key_state); - - return EventHandlerResult::OK; + if (keyToggledOn(key_state)) { + if (mapped_key == Key_Redial) { + mapped_key = last_key_; + } else if (shouldRemember(mapped_key)) { + last_key_ = mapped_key; + } } - - if (keyToggledOn(key_state) && shouldRemember(mapped_key)) { - last_key_ = mapped_key; - if (!redial_held_) - key_to_redial_ = mapped_key; - } - return EventHandlerResult::OK; } diff --git a/src/kaleidoscope/plugin/Redial.h b/src/kaleidoscope/plugin/Redial.h index ad483e59..5987e079 100644 --- a/src/kaleidoscope/plugin/Redial.h +++ b/src/kaleidoscope/plugin/Redial.h @@ -34,9 +34,7 @@ class Redial : public kaleidoscope::Plugin { EventHandlerResult onKeyswitchEvent(Key &mapped_key, KeyAddr key_addr, uint8_t key_state); private: - static Key key_to_redial_; static Key last_key_; - static bool redial_held_; }; }