Drop the V1 plugin API compatibility code

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

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

@ -23,13 +23,6 @@ class MouseKeys_ : public kaleidoscope::Plugin {
kaleidoscope::EventHandlerResult afterEachCycle(); kaleidoscope::EventHandlerResult afterEachCycle();
kaleidoscope::EventHandlerResult onKeyswitchEvent(Key &mappedKey, byte row, byte col, uint8_t keyState); kaleidoscope::EventHandlerResult onKeyswitchEvent(Key &mappedKey, byte row, byte col, uint8_t keyState);
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
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: private:
static uint8_t mouseMoveIntent; static uint8_t mouseMoveIntent;
static uint32_t endTime; static uint32_t endTime;

Loading…
Cancel
Save