Skip to content

ChartMouseEventArgs.CtrlKey

property · ChartMouseEventArgs · cAlgo.API

DesktopCLICloud

Defines whether the Ctrl key is pressed during the mouse event.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (ChartArea.MouseDown, ChartArea.MouseEnter, ChartArea.MouseLeave and more).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (ChartArea.MouseDown, ChartArea.MouseEnter, ChartArea.MouseLeave and more).

Definition

public bool CtrlKey {get;}
chartMouseEventArgs.CtrlKey: bool

Returns bool

Examples

protected override void OnStart()
{
    Chart.MouseDown += OnChartMouseDown;
}

private void OnChartMouseDown(ChartMouseEventArgs args)
{
    if (args.CtrlKey)
        PlaceLimitOrder(TradeType.Buy, SymbolName, 10000, args.YValue, "ctrlClick");
}
def on_start(self):
    api.Chart.MouseDown += self.on_chart_mouse_down

def on_chart_mouse_down(self, args):
    if args.CtrlKey:
        api.PlaceLimitOrder(TradeType.Buy, api.SymbolName, 10000, args.YValue, "ctrlClick")