---
id: "P:cAlgo.API.ChartKeyboardEventArgs.AltKey"
kind: "property"
type: "T:cAlgo.API.ChartKeyboardEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/AltKey/"
---

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

# ChartKeyboardEventArgs.AltKey

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

## AltKey

True if Alt key was pressed otherwise False

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

- CLI: Never raised in the CLI: the events that pass it never fire there (Chart.KeyDown).
- Cloud: Never raised in the cloud: the events that pass it never fire there (Chart.KeyDown).

C#:

```csharp
public bool AltKey {get;}
```

Python:

```python
chartKeyboardEventArgs.AltKey: bool
```

### Returns

`bool` — 

### Examples

C#:

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

private void OnChartKeyDown(ChartKeyboardEventArgs args)
{
    if (args.AltKey)
        Print("Alt + {0} pressed", args.Key);
}
```

Python:

```python
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")
```

