-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FindMyMouse]Add additional settings (#14590)
* [FindMyMouse]Add additional settings * Add setting for Spotlight Initial Zoom * PR feedback: lowercase settings names * PR feedback: settings descriptions * PR feedback: change opacity to percentage * PR feedback: increase maximum zoom factor * PR feedback: group spotlight settings * PR feedback: Expanders start collapsed initially * Remove extra settings file save in dllmain * PR feedback: change initial zoom description * PR feedback: Add warning for photo sensitive users * PR feedback: remove warning and add description instead * PR feedback: size->factor in initial zoom description * Feedback PR: remove opacity description * PR feedback: remove photo sensitivity warning
- Loading branch information
1 parent
8afac77
commit 46244e8
Showing
10 changed files
with
482 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
// helper function to get the RGB from a #FFFFFF string. | ||
inline bool checkValidRGB(std::wstring_view hex, uint8_t* R, uint8_t* G, uint8_t* B) | ||
{ | ||
if (hex.length() != 7) | ||
return false; | ||
hex = hex.substr(1, 6); // remove # | ||
for (auto& c : hex) | ||
{ | ||
if (!((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F'))) | ||
{ | ||
return false; | ||
} | ||
} | ||
if (swscanf_s(hex.data(), L"%2hhx%2hhx%2hhx", R, G, B) != 3) | ||
{ | ||
return false; | ||
} | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
#pragma once | ||
#include "pch.h" | ||
int FindMyMouseMain(HINSTANCE hinst); | ||
|
||
constexpr bool FIND_MY_MOUSE_DEFAULT_DO_NOT_ACTIVATE_ON_GAME_MODE = true; | ||
const winrt::Windows::UI::Color FIND_MY_MOUSE_DEFAULT_BACKGROUND_COLOR = winrt::Windows::UI::ColorHelper::FromArgb(255, 0, 0, 0); | ||
const winrt::Windows::UI::Color FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_COLOR = winrt::Windows::UI::ColorHelper::FromArgb(255, 255, 255, 255); | ||
constexpr int FIND_MY_MOUSE_DEFAULT_OVERLAY_OPACITY = 50; | ||
constexpr int FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_RADIUS = 100; | ||
constexpr int FIND_MY_MOUSE_DEFAULT_ANIMATION_DURATION_MS = 500; | ||
constexpr int FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_INITIAL_ZOOM = 9; | ||
|
||
struct FindMyMouseSettings | ||
{ | ||
bool doNotActivateOnGameMode = FIND_MY_MOUSE_DEFAULT_DO_NOT_ACTIVATE_ON_GAME_MODE; | ||
winrt::Windows::UI::Color backgroundColor = FIND_MY_MOUSE_DEFAULT_BACKGROUND_COLOR; | ||
winrt::Windows::UI::Color spotlightColor = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_COLOR; | ||
int overlayOpacity = FIND_MY_MOUSE_DEFAULT_OVERLAY_OPACITY; | ||
int spotlightRadius = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_RADIUS; | ||
int animationDurationMs = FIND_MY_MOUSE_DEFAULT_ANIMATION_DURATION_MS; | ||
int spotlightInitialZoom = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_INITIAL_ZOOM; | ||
}; | ||
|
||
int FindMyMouseMain(HINSTANCE hinst, const FindMyMouseSettings& settings); | ||
void FindMyMouseDisable(); | ||
bool FindMyMouseIsEnabled(); | ||
void FindMyMouseSetDoNotActivateOnGameMode(bool doNotActivate); | ||
void FindMyMouseApplySettings(const FindMyMouseSettings& settings); |
Oops, something went wrong.