mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 16:46:31 +00:00
rework throttle
reuse throttle mechanism for catching global keys
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
using Azaion.Annotator.DTO;
|
||||
using LibVLCSharp.Shared;
|
||||
using MediatR;
|
||||
@@ -24,8 +23,6 @@ public class PlayerControlHandler(LibVLC libVLC,
|
||||
private const int LARGE_STEP = 5000;
|
||||
private const int RESULT_WIDTH = 1280;
|
||||
|
||||
private static readonly string[] CatchSenders = ["ForegroundWindow", "ScrollViewer", "VideoView", "GridSplitter"];
|
||||
|
||||
private readonly Dictionary<Key, PlaybackControlEnum> _keysControlEnumDict = new()
|
||||
{
|
||||
{ Key.Space, PlaybackControlEnum.Pause },
|
||||
@@ -55,8 +52,7 @@ public class PlayerControlHandler(LibVLC libVLC,
|
||||
|
||||
public async Task Handle(KeyEvent notification, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!CatchSenders.Contains(notification.Sender.GetType().Name))
|
||||
return;
|
||||
logger.LogInformation($"Catch {notification.Args.Key} by {notification.Sender.GetType().Name}");
|
||||
|
||||
var key = notification.Args.Key;
|
||||
var keyNumber = (int?)null;
|
||||
|
||||
Reference in New Issue
Block a user