[MouseUtils]Auto activate setting for highlighter and crosshairs (#27826)

* auto activate for mouse highlighter and crosshairs

* revert changed encoding
This commit is contained in:
Davide Giacometti
2023-08-08 18:01:23 +02:00
committed by GitHub
parent a49f806ac7
commit 8e712c6f49
11 changed files with 112 additions and 9 deletions

View File

@@ -17,6 +17,7 @@ namespace
const wchar_t JSON_KEY_HIGHLIGHT_RADIUS[] = L"highlight_radius";
const wchar_t JSON_KEY_HIGHLIGHT_FADE_DELAY_MS[] = L"highlight_fade_delay_ms";
const wchar_t JSON_KEY_HIGHLIGHT_FADE_DURATION_MS[] = L"highlight_fade_duration_ms";
const wchar_t JSON_KEY_AUTO_ACTIVATE[] = L"auto_activate";
}
extern "C" IMAGE_DOS_HEADER __ImageBase;
@@ -356,6 +357,16 @@ public:
{
Logger::warn("Failed to initialize Fade Duration from settings. Will use default value");
}
try
{
// Parse auto activate
auto jsonPropertiesObject = settingsObject.GetNamedObject(JSON_KEY_PROPERTIES).GetNamedObject(JSON_KEY_AUTO_ACTIVATE);
highlightSettings.autoActivate = jsonPropertiesObject.GetNamedBoolean(JSON_KEY_VALUE);
}
catch (...)
{
Logger::warn("Failed to initialize auto activate from settings. Will use default value");
}
}
else
{