Skip to content

ChartKeyboardEventArgs.AltKey

property · ChartKeyboardEventArgs · cAlgo.API

DesktopCLICloud

True if Alt key was pressed otherwise False

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 bool AltKey {get;}
chartKeyboardEventArgs.AltKey: bool

Returns bool

Examples

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

private void OnChartKeyDown(ChartKeyboardEventArgs args)
{
    if (args.AltKey)
        Print("Alt + {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.AltKey:
        api.Print(f"Alt + {args.Key} pressed")