Use default SpecialKeyState

This commit is contained in:
VictoriousRaptor 2023-11-20 23:20:59 +08:00
parent 798d30ea27
commit 6625e91182
2 changed files with 8 additions and 1 deletions

View file

@ -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
};
}
}

View file

@ -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);