diff --git a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h index 99a1581fba..38d7c87911 100644 --- a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h +++ b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShift.h @@ -276,6 +276,7 @@ class AutoShiftConfig : public Plugin { public: EventHandlerResult onSetup(); EventHandlerResult onFocusEvent(const char *input); + void disableAutoShiftIfUnconfigured(); private: // The base address in persistent storage for configuration data diff --git a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp index bcc243dbb8..52cf851e0b 100644 --- a/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp +++ b/plugins/Kaleidoscope-AutoShift/src/kaleidoscope/plugin/AutoShiftConfig.cpp @@ -45,6 +45,11 @@ EventHandlerResult AutoShiftConfig::onSetup() { return EventHandlerResult::OK; } +void AutoShiftConfig::disableAutoShiftIfUnconfigured() { + if (Runtime.storage().isSliceUninitialized(settings_base_, sizeof(AutoShift::settings_))) + ::AutoShift.disable(); +} + EventHandlerResult AutoShiftConfig::onFocusEvent(const char *input) { enum { ENABLED,