Drop the V1 plugin API compatibility code

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/365/head
Gergely Nagy 6 years ago
parent dbb146627a
commit 0dc276327f

@ -218,27 +218,4 @@ kaleidoscope::EventHandlerResult Macros_::beforeReportingState() {
return kaleidoscope::EventHandlerResult::OK;
}
// Legacy V1 API
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
void Macros_::begin() {
Kaleidoscope.useEventHandlerHook(legacyEventHandler);
Kaleidoscope.useLoopHook(legacyLoopHook);
}
Key Macros_::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state) {
kaleidoscope::EventHandlerResult r = Macros.onKeyswitchEvent(mapped_key, row, col, key_state);
if (r == kaleidoscope::EventHandlerResult::OK)
return mapped_key;
return Key_NoKey;
}
void Macros_::legacyLoopHook(bool is_post_clear) {
if (is_post_clear) {
Macros.afterEachCycle();
} else {
Macros.beforeReportingState();
}
}
#endif
Macros_ Macros;

@ -57,17 +57,6 @@ class Macros_ : public kaleidoscope::Plugin {
static byte row, col;
#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:
Key lookupAsciiCode(uint8_t ascii_code);
};

Loading…
Cancel
Save