mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
Added telemetry for Color Picker module (#5259)
* Added telemetry for Color Picker module * Closing color picker with Esc and added a telemetry for that * Missed update of csproj * updated installer to include telemetry.dll for color picker * removed telemetry.dll it was alrady there * after review changes
This commit is contained in:
@@ -62,6 +62,9 @@
|
||||
<Compile Include="Settings\IUserSettings.cs" />
|
||||
<Compile Include="Settings\SettingItem.cs" />
|
||||
<Compile Include="Settings\UserSettings.cs" />
|
||||
<Compile Include="Telemetry\ColorPickerCancelledEvent.cs" />
|
||||
<Compile Include="Telemetry\ColorPickerShowEvent.cs" />
|
||||
<Compile Include="Telemetry\ColorPickerZoomOpenedEvent.cs" />
|
||||
<Compile Include="Win32Apis.cs" />
|
||||
<Compile Include="ZoomWindow.xaml.cs">
|
||||
<DependentUpon>ZoomWindow.xaml</DependentUpon>
|
||||
@@ -177,6 +180,10 @@
|
||||
<Project>{4AED67B6-55FD-486F-B917-E543DEE2CB3C}</Project>
|
||||
<Name>ManagedCommon</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\Telemetry.csproj">
|
||||
<Project>{5d00d290-4016-4cfe-9e41-1e7c724509ba}</Project>
|
||||
<Name>Telemetry</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\core\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj">
|
||||
<Project>{b1bcc8c6-46b5-4bfa-8f22-20f32d99ec6a}</Project>
|
||||
<Name>Microsoft.PowerToys.Settings.UI.Lib</Name>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using ColorPicker.ViewModelContracts;
|
||||
using ColorPicker.Telemetry;
|
||||
using ColorPicker.ViewModelContracts;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using System;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Drawing;
|
||||
@@ -163,6 +165,7 @@ namespace ColorPicker.Helpers
|
||||
{
|
||||
_zoomWindow.Left = _lastLeft + 1;
|
||||
_zoomWindow.Top = _lastTop + 1;
|
||||
PowerToysTelemetry.Log.WriteEvent(new ColorPickerZoomOpenedEvent());
|
||||
}
|
||||
|
||||
_zoomWindow.DesiredLeft = _lastLeft;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Windows.Input;
|
||||
using ColorPicker.Helpers;
|
||||
using ColorPicker.Settings;
|
||||
using ColorPicker.Telemetry;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Utilities;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
|
||||
namespace ColorPicker.Keyboard
|
||||
{
|
||||
@@ -56,6 +59,14 @@ namespace ColorPicker.Keyboard
|
||||
private void Hook_KeyboardPressed(object sender, GlobalKeyboardHookEventArgs e)
|
||||
{
|
||||
var virtualCode = e.KeyboardData.VirtualCode;
|
||||
// ESC pressed
|
||||
if(virtualCode == KeyInterop.VirtualKeyFromKey(Key.Escape))
|
||||
{
|
||||
_currentlyPressedKeys.Clear();
|
||||
_appStateHandler.HideColorPicker();
|
||||
PowerToysTelemetry.Log.WriteEvent(new ColorPickerCancelledEvent());
|
||||
}
|
||||
|
||||
var name = Helper.GetKeyName((uint)virtualCode);
|
||||
|
||||
// we got modifier with additional info such as "Ctrl (left)" - get rid of parenthesess
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace ColorPicker.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class ColorPickerCancelledEvent : EventBase, IEvent
|
||||
{
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace ColorPicker.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class ColorPickerShowEvent : EventBase, IEvent
|
||||
{
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace ColorPicker.Telemetry
|
||||
{
|
||||
[EventData]
|
||||
public class ColorPickerZoomOpenedEvent : EventBase, IEvent
|
||||
{
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,9 @@ using ColorPicker.Keyboard;
|
||||
using ColorPicker.Mouse;
|
||||
using ColorPicker.Settings;
|
||||
using ColorPicker.ViewModelContracts;
|
||||
using ColorPicker.Telemetry;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
|
||||
namespace ColorPicker.ViewModels
|
||||
{
|
||||
@@ -108,6 +110,7 @@ namespace ColorPicker.ViewModels
|
||||
CopyToClipboard(colorRepresentationToCopy);
|
||||
|
||||
_appStateHandler.HideColorPicker();
|
||||
PowerToysTelemetry.Log.WriteEvent(new ColorPickerShowEvent());
|
||||
}
|
||||
|
||||
private static void CopyToClipboard(string colorRepresentationToCopy)
|
||||
|
||||
Reference in New Issue
Block a user