diff --git a/src/modules/MouseUtils/FindMyMouse/FindMyMouse.cpp b/src/modules/MouseUtils/FindMyMouse/FindMyMouse.cpp index f953af0fdd..5221e12a63 100644 --- a/src/modules/MouseUtils/FindMyMouse/FindMyMouse.cpp +++ b/src/modules/MouseUtils/FindMyMouse/FindMyMouse.cpp @@ -155,7 +155,7 @@ private: void DetectShake(); bool KeyboardInputCanActivate(); - void StartSonar(); + void StartSonar(FindMyMouseActivationMethod activationMethod); void StopSonar(); }; @@ -275,7 +275,7 @@ LRESULT SuperSonar::BaseWndProc(UINT message, WPARAM wParam, LPARAM lParam) n { if (m_sonarStart == NoSonar) { - StartSonar(); + StartSonar(FindMyMouseActivationMethod::Shortcut); } else { @@ -384,7 +384,7 @@ void SuperSonar::OnSonarKeyboardInput(RAWINPUT const& input) IsEqual(m_lastKeyPos, ptCursor)) { m_sonarState = SonarState::ControlDown2; - StartSonar(); + StartSonar(m_activationMethod); } else { @@ -451,7 +451,7 @@ void SuperSonar::DetectShake() if (diagonal > 0 && distanceTravelled / diagonal > (m_shakeFactor / 100.f)) { m_movementHistory.clear(); - StartSonar(); + StartSonar(m_activationMethod); } } @@ -519,7 +519,7 @@ void SuperSonar::OnSonarMouseInput(RAWINPUT const& input) } template -void SuperSonar::StartSonar() +void SuperSonar::StartSonar(FindMyMouseActivationMethod activationMethod) { // Don't activate if game mode is on. if (m_doNotActivateOnGameMode && detect_game_mode()) @@ -532,7 +532,7 @@ void SuperSonar::StartSonar() return; } - Trace::MousePointerFocused(); + Trace::MousePointerFocused(static_cast(activationMethod)); // Cover the entire virtual screen. // HACK: Draw with 1 pixel off. Otherwise, Windows glitches the task bar transparency when a transparent window fill the whole screen. SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0); diff --git a/src/modules/MouseUtils/FindMyMouse/trace.cpp b/src/modules/MouseUtils/FindMyMouse/trace.cpp index bf79461e9a..6309596cf8 100644 --- a/src/modules/MouseUtils/FindMyMouse/trace.cpp +++ b/src/modules/MouseUtils/FindMyMouse/trace.cpp @@ -22,11 +22,12 @@ void Trace::EnableFindMyMouse(const bool enabled) noexcept } // Log that the user activated the module by focusing the mouse pointer -void Trace::MousePointerFocused() noexcept +void Trace::MousePointerFocused(const int activationMethod) noexcept { TraceLoggingWriteWrapper( g_hProvider, "FindMyMouse_MousePointerFocused", ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); + TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE), + TraceLoggingInt32(activationMethod, "ActivationMethod")); } diff --git a/src/modules/MouseUtils/FindMyMouse/trace.h b/src/modules/MouseUtils/FindMyMouse/trace.h index 59d3183b5b..90933e9403 100644 --- a/src/modules/MouseUtils/FindMyMouse/trace.h +++ b/src/modules/MouseUtils/FindMyMouse/trace.h @@ -9,5 +9,6 @@ public: static void EnableFindMyMouse(const bool enabled) noexcept; // Log that the user activated the module by focusing the mouse pointer - static void MousePointerFocused() noexcept; + // activationMethod: 0 = DoubleLeftControlKey, 1 = DoubleRightControlKey, 2 = ShakeMouse, 3 = Shortcut + static void MousePointerFocused(const int activationMethod) noexcept; };