---
id: "E:cAlgo.API.ChartArea.MouseDown"
kind: "event"
type: "T:cAlgo.API.ChartArea"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/MouseDown/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ChartArea.MouseDown

Member of [ChartArea](https://help.ctrader.com/ctrader-algo/references/Chart/ChartArea/index.md).

## MouseDown

Occurs when the left mouse button is pressed down.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never raised: no chart is displayed, so there is nothing to interact with.
- Cloud: Never raised: no chart is displayed, so there is nothing to interact with.

C#:

```csharp
event Action<ChartMouseEventArgs> MouseDown;
```

Python:

```python
chartArea.MouseDown += handler  # handler(obj: ChartMouseEventArgs)
```

### Returns

`Action<ChartMouseEventArgs>` — 

### Examples

C#:

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

private void OnChartMouseDown(ChartMouseEventArgs args)
{
    if (args.CtrlKey)
        Chart.DrawHorizontalLine("clickLevel", args.YValue, Color.Yellow);
}
```

Python:

```python
def on_start(self):
    api.Chart.MouseDown += self.on_chart_mouse_down

def on_chart_mouse_down(self, args):
    if args.CtrlKey:
        api.Chart.DrawHorizontalLine("clickLevel", args.YValue, Color.Yellow)
```

