Drop the V1 plugin API compatibility code

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/389/head
Gergely Nagy 6 years ago
parent 28dc505ef0
commit 47c3fbd2ec

@ -81,20 +81,6 @@ EventHandlerResult Cycle::onKeyswitchEvent(Key &mapped_key, byte row, byte col,
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
// Deprecated v1 API
void Cycle::begin() {
Kaleidoscope.useEventHandlerHook(legacyEventHandler);
}
Key Cycle::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state) {
EventHandlerResult r = ::Cycle.onKeyswitchEvent(mapped_key, row, col, key_state);
if (r == EventHandlerResult::OK)
return mapped_key;
return Key_NoKey;
}
#endif
}; };
__attribute__((weak)) __attribute__((weak))

@ -38,16 +38,6 @@ class Cycle : public kaleidoscope::Plugin {
EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t key_state); EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t key_state);
#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);
#endif
private: private:
static Key last_non_cycle_key_; static Key last_non_cycle_key_;
static uint8_t cycle_count_; static uint8_t cycle_count_;

Loading…
Cancel
Save