PowerArgs.Cli.KeyboardShortcut.KeyboardShortcut C# (CSharp) Method

KeyboardShortcut() public method

Creates a new shortut
public KeyboardShortcut ( ConsoleKey key, ConsoleModifiers modifier = null ) : System
key ConsoleKey the shortcut key
modifier ConsoleModifiers A key modifier (e.g. shift, alt) that, when present, must be pressed in order for the shortcut key to trigger. Note that control is not /// supported because it doesn't play well in a console
return System
        public KeyboardShortcut(ConsoleKey key, ConsoleModifiers? modifier = null)
        {
            this.Key = key;
            this.Modifier = modifier;
            if(modifier == ConsoleModifiers.Control)
            {
                throw new InvalidOperationException("Control is not supported as a keyboard shortcut modifier");
            }
        }
KeyboardShortcut