From d8bfa75cdf767b88d71f328ded82ca59f5ffc3cb Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 20 Aug 2018 23:25:38 +0200 Subject: [PATCH] Drop the V1 plugin API compatibility code Signed-off-by: Gergely Nagy --- src/Kaleidoscope/ShapeShifter.cpp | 21 --------------------- src/Kaleidoscope/ShapeShifter.h | 11 ----------- 2 files changed, 32 deletions(-) diff --git a/src/Kaleidoscope/ShapeShifter.cpp b/src/Kaleidoscope/ShapeShifter.cpp index 2aa1f534..d78f8cce 100644 --- a/src/Kaleidoscope/ShapeShifter.cpp +++ b/src/Kaleidoscope/ShapeShifter.cpp @@ -60,27 +60,6 @@ EventHandlerResult ShapeShifter::onKeyswitchEvent(Key &mapped_key, byte row, byt return EventHandlerResult::OK; } -// Legacy V1 API -#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API -void ShapeShifter::begin() { - Kaleidoscope.useEventHandlerHook(legacyEventHandler); - Kaleidoscope.useLoopHook(legacyLoopHook); -} - -Key ShapeShifter::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state) { - EventHandlerResult r = ::ShapeShifter.onKeyswitchEvent(mapped_key, row, col, key_state); - if (r == EventHandlerResult::OK) - return mapped_key; - return Key_NoKey; -} - -void ShapeShifter::legacyLoopHook(bool is_post_clear) { - if (is_post_clear) - return; - ::ShapeShifter.beforeReportingState(); -} -#endif - } kaleidoscope::ShapeShifter ShapeShifter; diff --git a/src/Kaleidoscope/ShapeShifter.h b/src/Kaleidoscope/ShapeShifter.h index ff90afda..ffe3f4c2 100644 --- a/src/Kaleidoscope/ShapeShifter.h +++ b/src/Kaleidoscope/ShapeShifter.h @@ -35,17 +35,6 @@ class ShapeShifter : public KaleidoscopePlugin { EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t key_state); EventHandlerResult beforeReportingState(); -#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 bool mod_active_; };