From 5d670194fe7ae98a5aebd6ff439c633ba2abe230 Mon Sep 17 00:00:00 2001 From: Dobin Park Date: Wed, 13 Oct 2021 01:45:18 +0900 Subject: [PATCH] Add delay --- Flow.Launcher/Helper/HotKeyMapper.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/Helper/HotKeyMapper.cs b/Flow.Launcher/Helper/HotKeyMapper.cs index d5fcabace..87ef0628b 100644 --- a/Flow.Launcher/Helper/HotKeyMapper.cs +++ b/Flow.Launcher/Helper/HotKeyMapper.cs @@ -6,6 +6,8 @@ using NHotkey.Wpf; using Flow.Launcher.Core.Resource; using System.Windows; using Flow.Launcher.ViewModel; +using System.Threading.Tasks; +using System.Threading; namespace Flow.Launcher.Helper { @@ -58,8 +60,10 @@ namespace Flow.Launcher.Helper if (!ShouldIgnoreHotkeys()) { UpdateLastQUeryMode(); - - mainViewModel.ToggleFlowLauncher(); + + var overlayTask = Task.Delay(20).ContinueWith(_ => { + mainViewModel.ToggleFlowLauncher(); + }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); e.Handled = true; } } @@ -77,7 +81,7 @@ namespace Flow.Launcher.Helper switch(settings.LastQueryMode) { case LastQueryMode.Empty: - mainViewModel.ChangeQueryText(string.Empty); + mainViewModel.ChangeQueryText(""); break; case LastQueryMode.Preserved: mainViewModel.LastQuerySelected = true;