Skip to content

Commit

Permalink
Try harder to not default Space Cadet to on unless the user has expli…
Browse files Browse the repository at this point in the history
…ctly turned it on
  • Loading branch information
obra committed Mar 6, 2024
1 parent b1517a4 commit acea925
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit acea925

Please sign in to comment.