Drop the V1 plugin API compatibility code

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/389/head^2
Gergely Nagy 6 years ago
parent c489f6702f
commit d8bfa75cdf

@ -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;

@ -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_;
};

Loading…
Cancel
Save