diff --git a/Flow.Launcher.Infrastructure/Hotkey/HotkeyModel.cs b/Flow.Launcher.Infrastructure/Hotkey/HotkeyModel.cs index b2f6ee719..a6037a81d 100644 --- a/Flow.Launcher.Infrastructure/Hotkey/HotkeyModel.cs +++ b/Flow.Launcher.Infrastructure/Hotkey/HotkeyModel.cs @@ -187,6 +187,7 @@ namespace Flow.Launcher.Infrastructure.Hotkey } } + // WPF Control hotkey form i.e. simplified text e.g. LeftAlt+X -> Alt + X, includes space around '+' public readonly string ToWPFHotkeyString() { var hotkey = string.Empty; @@ -220,9 +221,9 @@ namespace Flow.Launcher.Infrastructure.Hotkey return hotkey; } - public IEnumerable EnumerateDisplayKeys() => !string.IsNullOrEmpty(HotkeyRaw) ? HotkeyRaw.Split('+') : Array.Empty(); + // Display in the form of WPF Control i.e. simplified text e.g. LeftAlt -> Alt + public IEnumerable EnumerateDisplayKeys() => !string.IsNullOrEmpty(HotkeyRaw) ? ToWPFHotkeyString().Split(" + ") : Array.Empty(); - //For WPF hotkey control public string FromWPFKeysToString() => string.Join("+", EnumerateWPFKeys()); public IEnumerable EnumerateWPFKeys() diff --git a/Flow.Launcher/HotkeyControlDialog.xaml.cs b/Flow.Launcher/HotkeyControlDialog.xaml.cs index e4a2d8cad..13734a831 100644 --- a/Flow.Launcher/HotkeyControlDialog.xaml.cs +++ b/Flow.Launcher/HotkeyControlDialog.xaml.cs @@ -161,8 +161,6 @@ public partial class HotkeyControlDialog : ContentDialog return; } - IEnumerable enumerateMethod; - foreach (var key in hotkey.Value.EnumerateDisplayKeys()!) { KeysToDisplay.Add(key);