From 335dcbaae83c8ffb136958a39deceadca35154aa Mon Sep 17 00:00:00 2001
From: Jaylyn Barbee <51131738+Jaylyn-Barbee@users.noreply.github.com>
Date: Mon, 5 Jan 2026 20:54:37 -0500
Subject: [PATCH] [Light Switch] Adding telemetry events (#44241)
Adding events to track the following:
| Event Name |
Description |
Data collected |
| Microsoft.PowerToys.LightSwitch_EnableLightSwitch |
Triggered when Light Switch is enabled or disabled. |
Whether the module is enabled or disabled (bool) |
| Microsoft.PowerToys.LightSwitch_ShortcutInvoked |
Occurs when the shortcut for Light Switch is invoked. |
|
| Microsoft.PowerToys.LightSwitch_ScheduleModeToggled |
Occurs when a new schedule mode is selected for Light Switch. |
The new mode selected (string) |
| Microsoft.PowerToys.LightSwitch_ThemeTargetChanged |
Occurs when the options for targeting the system or apps is
updated. |
The new options selected (two bools) |
The above events that are related to Light Switch settings are tracked
in the "LoadSettings" function inside the service but only if the value
has changed. The Enabled event as well as the Shortcut event are tracked
in the module interface.
---
DATA_AND_PRIVACY.md | 24 +++++++++++
.../LightSwitchModuleInterface/dllmain.cpp | 6 ++-
.../LightSwitchModuleInterface/trace.cpp | 15 +++++--
.../LightSwitchModuleInterface/trace.h | 3 +-
.../LightSwitchService/LightSwitchService.cpp | 7 ++-
.../LightSwitchService.vcxproj | 2 +
.../LightSwitchService.vcxproj.filters | 6 +++
.../LightSwitchSettings.cpp | 12 ++++++
.../LightSwitch/LightSwitchService/trace.cpp | 43 +++++++++++++++++++
.../LightSwitch/LightSwitchService/trace.h | 17 ++++++++
10 files changed, 129 insertions(+), 6 deletions(-)
create mode 100644 src/modules/LightSwitch/LightSwitchService/trace.cpp
create mode 100644 src/modules/LightSwitch/LightSwitchService/trace.h
diff --git a/DATA_AND_PRIVACY.md b/DATA_AND_PRIVACY.md
index 66a0daa1d8..07089e44c3 100644
--- a/DATA_AND_PRIVACY.md
+++ b/DATA_AND_PRIVACY.md
@@ -694,6 +694,30 @@ _If you want to find diagnostic data events in the source code, these two links
+### Light Switch
+
+
+ | Event Name |
+ Description |
+
+
+ | Microsoft.PowerToys.LightSwitch_EnableLightSwitch |
+ Triggered when Light Switch is enabled or disabled. |
+
+
+ | Microsoft.PowerToys.LightSwitch_ShortcutInvoked |
+ Occurs when the shortcut for Light Switch is invoked. |
+
+
+ | Microsoft.PowerToys.LightSwitch_ScheduleModeToggled |
+ Occurs when a new schedule mode is selected for Light Switch. |
+
+
+ | Microsoft.PowerToys.LightSwitch_ThemeTargetChanged |
+ Occurs when the options for targeting the system or apps is updated. |
+
+
+
### Mouse Highlighter