mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[FindMyMouse]Do not activate on game mode (#13990)
* [FindMyMouse] Do not activate on game mode * Add settings scaffolding * fix spellchecker * Address PR comments * Adress UI feedback
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "pch.h"
|
||||
#include "FindMyMouse.h"
|
||||
#include "trace.h"
|
||||
#include "common/utils/game_mode.h"
|
||||
|
||||
#ifdef COMPOSITION
|
||||
namespace winrt
|
||||
@@ -18,6 +19,8 @@ namespace ABI
|
||||
}
|
||||
#endif
|
||||
|
||||
bool m_doNotActivateOnGameMode = true;
|
||||
|
||||
#pragma region Super_Sonar_Base_Code
|
||||
|
||||
template<typename D>
|
||||
@@ -250,6 +253,12 @@ void SuperSonar<D>::OnSonarInput(WPARAM flags, HRAWINPUT hInput)
|
||||
template<typename D>
|
||||
void SuperSonar<D>::OnSonarKeyboardInput(RAWINPUT const& input)
|
||||
{
|
||||
// Don't activate if game mode is on.
|
||||
if (m_doNotActivateOnGameMode && detect_game_mode())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.data.keyboard.VKey != VK_CONTROL)
|
||||
{
|
||||
StopSonar();
|
||||
@@ -777,6 +786,11 @@ bool FindMyMouseIsEnabled()
|
||||
return (m_sonar != nullptr);
|
||||
}
|
||||
|
||||
void FindMyMouseSetDoNotActivateOnGameMode(bool doNotActivate)
|
||||
{
|
||||
m_doNotActivateOnGameMode = doNotActivate;
|
||||
}
|
||||
|
||||
// Based on SuperSonar's original wWinMain.
|
||||
int FindMyMouseMain(HINSTANCE hinst)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user