From b096944ba19d80694e263ce580e3e340b9777263 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:22:10 +0800 Subject: [PATCH] Add to modifier keys --- Flow.Launcher.Plugin/ActionContext.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Plugin/ActionContext.cs b/Flow.Launcher.Plugin/ActionContext.cs index b9e499d2b..d898972da 100644 --- a/Flow.Launcher.Plugin/ActionContext.cs +++ b/Flow.Launcher.Plugin/ActionContext.cs @@ -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); + } } -} \ No newline at end of file +}