From 590ea6184fa887a906cff6e80821787d95d23d98 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 26 Jun 2025 10:45:01 +0800 Subject: [PATCH] Skip other commands if executed --- Flow.Launcher/Helper/HotKeyMapper.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/Helper/HotKeyMapper.cs b/Flow.Launcher/Helper/HotKeyMapper.cs index c2c69beff..3dfe97d7c 100644 --- a/Flow.Launcher/Helper/HotKeyMapper.cs +++ b/Flow.Launcher/Helper/HotKeyMapper.cs @@ -251,11 +251,6 @@ internal static class HotKeyMapper { return new RelayCommand(() => { - if (_windowHotkeyEvents.TryGetValue(hotkey, out var existingCommand)) - { - existingCommand.Execute(null); - } - var selectedResult = _mainViewModel.Results.SelectedItem?.Result; // Check result nullability if (selectedResult != null) @@ -274,11 +269,20 @@ internal static class HotKeyMapper if (metadata.Disabled) continue; - // Invoke action - if (pluginHotkey.Action?.Invoke(selectedResult) ?? false) + // Check action nullability + if (pluginHotkey.Action == null) + continue; + + // Invoke action & return to skip other commands + if (pluginHotkey.Action.Invoke(selectedResult)) App.API.HideMainWindow(); } } + + if (_windowHotkeyEvents.TryGetValue(hotkey, out var existingCommand)) + { + existingCommand.Execute(null); + } }); }