Drop the V1 plugin API compatibility code

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

@ -68,20 +68,6 @@ EventHandlerResult AlphaSquareEffect::onKeyswitchEvent(Key &mappedKey, byte row,
return EventHandlerResult::OK; return EventHandlerResult::OK;
} }
// Legacy V1 API
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
void AlphaSquareEffect::setup(void) {
Kaleidoscope.useEventHandlerHook(legacyEventHandler);
}
Key AlphaSquareEffect::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state) {
EventHandlerResult r = ::AlphaSquareEffect.onKeyswitchEvent(mapped_key, row, col, key_state);
if (r == EventHandlerResult::OK)
return mapped_key;
return Key_NoKey;
}
#endif
} }
kaleidoscope::AlphaSquareEffect AlphaSquareEffect; kaleidoscope::AlphaSquareEffect AlphaSquareEffect;

@ -30,22 +30,9 @@ class AlphaSquareEffect : public LEDMode {
EventHandlerResult onKeyswitchEvent(Key &mappedKey, byte row, byte col, uint8_t keyState); EventHandlerResult onKeyswitchEvent(Key &mappedKey, byte row, byte col, uint8_t keyState);
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
kaleidoscope::EventHandlerResult onSetup() {
::LEDControl.mode_add(this);
return kaleidoscope::EventHandlerResult::OK;
}
#endif
protected: protected:
void update(void) final; void update(void) final;
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
void setup(void) final;
static Key legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state);
#endif
private: private:
static uint32_t end_time_left_, end_time_right_; static uint32_t end_time_left_, end_time_right_;
static Key last_key_left_, last_key_right_; static Key last_key_left_, last_key_right_;

Loading…
Cancel
Save