Add to modifier keys

This commit is contained in:
Vic 2023-03-24 14:22:10 +08:00
parent 9e5e2135f0
commit b096944ba1

View file

@ -1,4 +1,6 @@
namespace Flow.Launcher.Plugin
using System.Windows.Input;
namespace Flow.Launcher.Plugin
{
public class ActionContext
{
@ -11,5 +13,13 @@
public bool ShiftPressed { get; set; }
public bool AltPressed { get; set; }
public bool WinPressed { get; set; }
public ModifierKeys ToModifierKeys()
{
return (CtrlPressed ? ModifierKeys.Control : ModifierKeys.None) |
(ShiftPressed ? ModifierKeys.Shift : ModifierKeys.None) |
(AltPressed ? ModifierKeys.Alt : ModifierKeys.None) |
(WinPressed ? ModifierKeys.Windows : ModifierKeys.None);
}
}
}
}