mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 01:36:30 +00:00
rework throttle
reuse throttle mechanism for catching global keys
This commit is contained in:
@@ -9,6 +9,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog;
|
||||
using Azaion.Annotator.Extensions;
|
||||
|
||||
namespace Azaion.Annotator;
|
||||
|
||||
@@ -71,6 +72,6 @@ public partial class App : Application
|
||||
private void GlobalClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var args = (KeyEventArgs)e;
|
||||
_mediator.Publish(new KeyEvent(sender, args));
|
||||
_ = ThrottleExt.Throttle(() => _mediator.Publish(new KeyEvent(sender, args)), TimeSpan.FromMilliseconds(50));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user