Skip to content

ChartKeyboardEventArgs.Modifiers

property · ChartKeyboardEventArgs · cAlgo.API

DesktopCLICloud

Modifiers key that was used with the Key

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (Chart.KeyDown).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (Chart.KeyDown).

Definition

public ModifierKeys Modifiers {get;}
chartKeyboardEventArgs.Modifiers: ModifierKeys

Returns ModifierKeys

Examples

protected override void OnStart()
{
    Chart.KeyDown += OnChartKeyDown;
}

private void OnChartKeyDown(ChartKeyboardEventArgs args)
{
    if (args.Modifiers.HasFlag(ModifierKeys.Control) && args.Modifiers.HasFlag(ModifierKeys.Shift))
        Print("Ctrl + Shift + {0} pressed", args.Key);
}
def on_start(self):
    api.Chart.KeyDown += self.on_chart_key_down

def on_chart_key_down(self, args):
    if args.Modifiers.HasFlag(ModifierKeys.Control) and args.Modifiers.HasFlag(ModifierKeys.Shift):
        api.Print(f"Ctrl + Shift + {args.Key} pressed")