using System.Windows.Input;
namespace Flow.Launcher.Plugin
{
///
/// Context provided as a parameter when invoking a
/// or
///
public class ActionContext
{
///
/// Contains the press state of certain special keys.
///
public SpecialKeyState SpecialKeyState { get; set; }
}
///
/// Contains the press state of certain special keys.
///
public class SpecialKeyState
{
///
/// True if the Ctrl key is pressed.
///
public bool CtrlPressed { get; set; }
///
/// True if the Shift key is pressed.
///
public bool ShiftPressed { get; set; }
///
/// True if the Alt key is pressed.
///
public bool AltPressed { get; set; }
///
/// True if the Windows key is pressed.
///
public bool WinPressed { get; set; }
///
/// Get this object represented as a flag combination.
///
///
public ModifierKeys ToModifierKeys()
{
return (CtrlPressed ? ModifierKeys.Control : ModifierKeys.None) |
(ShiftPressed ? ModifierKeys.Shift : ModifierKeys.None) |
(AltPressed ? ModifierKeys.Alt : ModifierKeys.None) |
(WinPressed ? ModifierKeys.Windows : ModifierKeys.None);
}
///
/// Default object with all keys not pressed.
///
public static readonly SpecialKeyState Default = new () {
CtrlPressed = false,
ShiftPressed = false,
AltPressed = false,
WinPressed = false
};
}
}