diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs index 679e73976..9e3b28f0a 100644 --- a/Flow.Launcher/HotkeyControl.xaml.cs +++ b/Flow.Launcher/HotkeyControl.xaml.cs @@ -110,7 +110,10 @@ namespace Flow.Launcher SelectPrevItemHotkey, SelectPrevItemHotkey2, SelectNextItemHotkey, - SelectNextItemHotkey2 + SelectNextItemHotkey2, + // Plugin hotkeys + GlobalPluginHotkey, + WindowPluginHotkey, } // We can initialize settings in static field because it has been constructed in App constuctor @@ -142,6 +145,9 @@ namespace Flow.Launcher HotkeyType.SelectPrevItemHotkey2 => _settings.SelectPrevItemHotkey2, HotkeyType.SelectNextItemHotkey => _settings.SelectNextItemHotkey, HotkeyType.SelectNextItemHotkey2 => _settings.SelectNextItemHotkey2, + // Plugin hotkeys + HotkeyType.GlobalPluginHotkey => hotkey, + HotkeyType.WindowPluginHotkey => hotkey, _ => throw new System.NotImplementedException("Hotkey type not set") }; } @@ -201,6 +207,17 @@ namespace Flow.Launcher case HotkeyType.SelectNextItemHotkey2: _settings.SelectNextItemHotkey2 = value; break; + // Plugin hotkeys + case HotkeyType.GlobalPluginHotkey: + // We should not save it to settings here because it is a custom plugin hotkey + // and it will be saved in the plugin settings + hotkey = value; + break; + case HotkeyType.WindowPluginHotkey: + // We should not save it to settings here because it is a custom plugin hotkey + // and it will be saved in the plugin settings + hotkey = value; + break; default: throw new System.NotImplementedException("Hotkey type not set"); } diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs index de499a717..e32bc2dbe 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs @@ -80,7 +80,8 @@ public partial class SettingsPaneHotkey { var hotkeyControl = new HotkeyControl { - Type = HotkeyControl.HotkeyType.CustomQueryHotkey, + Type = hotkey.HotkeyType == HotkeyType.Global ? + HotkeyControl.HotkeyType.GlobalPluginHotkey : HotkeyControl.HotkeyType.WindowPluginHotkey, DefaultHotkey = hotkey.DefaultHotkey, ValidateKeyGesture = true };