mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[PowerOCR][Telemetry]Cancel and capture events (#20165)
This commit is contained in:
@@ -77,7 +77,7 @@ public static class WindowUtilities
|
|||||||
allFullscreenGrab.Add(overlay);
|
allFullscreenGrab.Add(overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRLaunchOverlayEvent());
|
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRInvokedEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool IsOCROverlayCreated()
|
internal static bool IsOCROverlayCreated()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
using PowerOCR.Helpers;
|
using PowerOCR.Helpers;
|
||||||
using PowerOCR.Utilities;
|
using PowerOCR.Utilities;
|
||||||
|
|
||||||
@@ -101,6 +102,7 @@ public partial class OCROverlay : Window
|
|||||||
{
|
{
|
||||||
case Key.Escape:
|
case Key.Escape:
|
||||||
WindowUtilities.CloseAllOCROverlays();
|
WindowUtilities.CloseAllOCROverlays();
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCancelledEvent());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -276,11 +278,13 @@ public partial class OCROverlay : Window
|
|||||||
}
|
}
|
||||||
|
|
||||||
WindowUtilities.CloseAllOCROverlays();
|
WindowUtilities.CloseAllOCROverlays();
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCaptureEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CancelMenuItem_Click(object sender, RoutedEventArgs e)
|
private void CancelMenuItem_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
WindowUtilities.CloseAllOCROverlays();
|
WindowUtilities.CloseAllOCROverlays();
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new PowerOCR.Telemetry.PowerOCRCancelledEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using Microsoft.PowerToys.Telemetry.Events;
|
|||||||
namespace PowerOCR.Telemetry
|
namespace PowerOCR.Telemetry
|
||||||
{
|
{
|
||||||
[EventData]
|
[EventData]
|
||||||
public class PowerOCRLaunchOverlayEvent : EventBase, IEvent
|
public class PowerOCRCancelledEvent : EventBase, IEvent
|
||||||
{
|
{
|
||||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace PowerOCR.Telemetry
|
||||||
|
{
|
||||||
|
[EventData]
|
||||||
|
public class PowerOCRCaptureEvent : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace PowerOCR.Telemetry
|
||||||
|
{
|
||||||
|
[EventData]
|
||||||
|
public class PowerOCRInvokedEvent : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user