From f264c7f1cb265ad477672073a57b7e84751167af Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 6 Mar 2024 11:59:12 -0800 Subject: [PATCH] Try harder to not default Space Cadet to on unless the user has explictly turned it on --- .../src/kaleidoscope/plugin/MouseKeysConfig.cpp | 2 +- .../src/kaleidoscope/plugin/OneShotConfig.cpp | 2 +- .../src/kaleidoscope/plugin/SpaceCadetConfig.cpp | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp index 67c7b4ff3a..c5f2b13254 100644 --- a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp +++ b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp @@ -33,7 +33,7 @@ namespace plugin { // MouseKeys configurator EventHandlerResult MouseKeysConfig::onSetup() { - bool success = ::EEPROMSettings.requestSliceAndLoadData(sizeof(::MouseKeys::settings_), &settings_base_, &::MouseKeys.settings_); + bool success = ::EEPROMSettings.requestSliceAndLoadData(sizeof(::MouseKeys.settings_), &settings_base_, &::MouseKeys.settings_); if (!success) { Runtime.storage().put(settings_base_, ::MouseKeys.settings_); diff --git a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp index e9e87ea5c1..ace1b6cc81 100644 --- a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp +++ b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp @@ -30,7 +30,7 @@ namespace kaleidoscope { namespace plugin { EventHandlerResult OneShotConfig::onSetup() { - bool success = ::EEPROMSettings.requestSliceAndLoadData(sizeof(::OneShot::settings_), &settings_base_, &::OneShot.settings_); + bool success = ::EEPROMSettings.requestSliceAndLoadData(sizeof(::OneShot.settings_), &settings_base_, &::OneShot.settings_); if (!success) { Runtime.storage().put(settings_base_, ::OneShot.settings_); diff --git a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadetConfig.cpp b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadetConfig.cpp index 980f5fdb39..ed03b147d7 100644 --- a/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadetConfig.cpp +++ b/plugins/Kaleidoscope-SpaceCadet/src/kaleidoscope/plugin/SpaceCadetConfig.cpp @@ -31,7 +31,10 @@ namespace kaleidoscope { namespace plugin { EventHandlerResult SpaceCadetConfig::onSetup() { - bool success = ::EEPROMSettings.requestSliceAndLoadData(sizeof(::SpaceCadet::settings_), &settings_base_, &::SpaceCadet.settings_); + bool success = ::EEPROMSettings.requestSliceAndLoadData(sizeof(::SpaceCadet.settings_), &settings_base_, &::SpaceCadet.settings_); + if (!success || (::SpaceCadet.settings_.mode != SpaceCadet::Mode::ON && ::SpaceCadet.settings_.mode != SpaceCadet::Mode::NO_DELAY)) { + ::SpaceCadet.disable(); + } return EventHandlerResult::OK; }