From 37f51cacbe2806fb45ba2943a7dd0140e9ce031f Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 20 Aug 2018 23:28:53 +0200 Subject: [PATCH] Drop the V1 plugin API compatibility code Signed-off-by: Gergely Nagy --- src/Kaleidoscope/TapDance.cpp | 23 ----------------------- src/Kaleidoscope/TapDance.h | 11 ----------- 2 files changed, 34 deletions(-) diff --git a/src/Kaleidoscope/TapDance.cpp b/src/Kaleidoscope/TapDance.cpp index a90304c7..b24a1453 100644 --- a/src/Kaleidoscope/TapDance.cpp +++ b/src/Kaleidoscope/TapDance.cpp @@ -222,29 +222,6 @@ EventHandlerResult TapDance::afterEachCycle() { return EventHandlerResult::OK; } -// Legacy V1 API - -#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API -void TapDance::begin() { - Kaleidoscope.useEventHandlerHook(legacyEventHandler); - Kaleidoscope.useLoopHook(legacyLoopHook); -} - -Key TapDance::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state) { - EventHandlerResult r = ::TapDance.onKeyswitchEvent(mapped_key, row, col, key_state); - if (r == EventHandlerResult::OK) - return mapped_key; - return Key_NoKey; -} - -void TapDance::legacyLoopHook(bool is_post_clear) { - if (!is_post_clear) - return; - - ::TapDance.afterEachCycle(); -} -#endif - } __attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, byte row, byte col, uint8_t tap_count, diff --git a/src/Kaleidoscope/TapDance.h b/src/Kaleidoscope/TapDance.h index 3169ae38..83062e28 100644 --- a/src/Kaleidoscope/TapDance.h +++ b/src/Kaleidoscope/TapDance.h @@ -49,17 +49,6 @@ class TapDance : public kaleidoscope::Plugin { EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t keyState); EventHandlerResult afterEachCycle(); -#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API - kaleidoscope::EventHandlerResult onSetup() { - return kaleidoscope::EventHandlerResult::OK; - } - - protected: - void begin(); - static Key legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state); - static void legacyLoopHook(bool is_post_clear); -#endif - private: static uint32_t end_time_; static uint8_t tap_count_[16];