Drop the V1 plugin API compatibility code

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/389/head
Gergely Nagy 6 years ago
parent 4499709cd5
commit 37f51cacbe

@ -222,29 +222,6 @@ EventHandlerResult TapDance::afterEachCycle() {
return EventHandlerResult::OK; 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, __attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, byte row, byte col, uint8_t tap_count,

@ -49,17 +49,6 @@ class TapDance : public kaleidoscope::Plugin {
EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t keyState); EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t keyState);
EventHandlerResult afterEachCycle(); 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: private:
static uint32_t end_time_; static uint32_t end_time_;
static uint8_t tap_count_[16]; static uint8_t tap_count_[16];

Loading…
Cancel
Save