From e087d33fbb40e7129130c628ad0cc1d8a2608a8d Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Sat, 28 Jun 2025 21:57:44 +0800
Subject: [PATCH] Add hotkey id check
---
Flow.Launcher.Plugin/Result.cs | 6 ++++++
Flow.Launcher/Helper/HotKeyMapper.cs | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs
index f0fcd48ff..f23ef535b 100644
--- a/Flow.Launcher.Plugin/Result.cs
+++ b/Flow.Launcher.Plugin/Result.cs
@@ -257,6 +257,12 @@ namespace Flow.Launcher.Plugin
///
public bool ShowBadge { get; set; } = false;
+ ///
+ /// List of hotkey IDs that are supported for this result.
+ /// Those hotkeys should be registed by IPluginHotkey interface.
+ ///
+ public IList HotkeyIds { get; set; } = new List();
+
///
/// Run this result, asynchronously
///
diff --git a/Flow.Launcher/Helper/HotKeyMapper.cs b/Flow.Launcher/Helper/HotKeyMapper.cs
index 889f1bc99..602cbd71c 100644
--- a/Flow.Launcher/Helper/HotKeyMapper.cs
+++ b/Flow.Launcher/Helper/HotKeyMapper.cs
@@ -269,6 +269,10 @@ internal static class HotKeyMapper
if (metadata.Disabled)
continue;
+ // Check hotkey supported state
+ if (!selectedResult.HotkeyIds.Contains(pluginHotkey.Id))
+ continue;
+
// Check action nullability
if (pluginHotkey.Action == null)
continue;