Drop the V1 plugin API compatibility code

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/389/head
Gergely Nagy 6 years ago
parent 24d298d459
commit 358a5572e5

@ -37,21 +37,6 @@ EventHandlerResult EscapeOneShot::onKeyswitchEvent(Key &mapped_key, byte row, by
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }
// Legacy V1 API
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
void EscapeOneShot::begin() {
Kaleidoscope.useEventHandlerHook(legacyEventHandler);
}
Key EscapeOneShot::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t keyState) {
EventHandlerResult r = ::EscapeOneShot.onKeyswitchEvent(mapped_key, row, col, keyState);
if (r == EventHandlerResult::OK)
return mapped_key;
return Key_NoKey;
}
#endif
} }
kaleidoscope::EscapeOneShot EscapeOneShot; kaleidoscope::EscapeOneShot EscapeOneShot;

@ -26,16 +26,6 @@ class EscapeOneShot : public kaleidoscope::Plugin {
EscapeOneShot(void) {} EscapeOneShot(void) {}
EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t keyState); EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t keyState);
#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 keyState);
#endif
}; };
} }

Loading…
Cancel
Save