diff --git a/Flow.Launcher.Plugin/ActionContext.cs b/Flow.Launcher.Plugin/ActionContext.cs index d6ba4894e..e31c8e31d 100644 --- a/Flow.Launcher.Plugin/ActionContext.cs +++ b/Flow.Launcher.Plugin/ActionContext.cs @@ -50,5 +50,12 @@ namespace Flow.Launcher.Plugin (AltPressed ? ModifierKeys.Alt : ModifierKeys.None) | (WinPressed ? ModifierKeys.Windows : ModifierKeys.None); } + + public static readonly SpecialKeyState Default = new () { + CtrlPressed = false, + ShiftPressed = false, + AltPressed = false, + WinPressed = false + }; } } diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 7dcd2f4d2..61bf0c4dc 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -286,7 +286,7 @@ namespace Flow.Launcher.ViewModel var hideWindow = await result.ExecuteAsync(new ActionContext { // not null means pressing modifier key + number, should ignore the modifier key - SpecialKeyState = index is not null ? new SpecialKeyState() : GlobalHotkey.CheckModifiers() + SpecialKeyState = index is not null ? SpecialKeyState.Default : GlobalHotkey.CheckModifiers() }) .ConfigureAwait(false);