---
id: "T:cAlgo.API.ChartKeyboardEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/"
---

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

# ChartKeyboardEventArgs (class)

Provides data for chart keyboard related events and callbacks

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).

## Definition

```csharp
public class ChartKeyboardEventArgs
```

## Examples

C#:

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

private void OnChartKeyDown(ChartKeyboardEventArgs args)
{
    Print("Key: {0} | Modifiers: {1} | Ctrl: {2} | Shift: {3} | Alt: {4}", args.Key, args.Modifiers, args.CtrlKey, args.ShiftKey, args.AltKey);
}
```

Python:

```python
def on_start(self):
    api.Chart.KeyDown += self.on_chart_key_down

def on_chart_key_down(self, args):
    api.Print(f"Key: {args.Key} | Modifiers: {args.Modifiers} | Ctrl: {args.CtrlKey} | Shift: {args.ShiftKey} | Alt: {args.AltKey}")
```

## Properties

- `public bool AltKey {get;}` — True if Alt key was pressed otherwise False [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/AltKey/index.md)
- `public Chart Chart {get;}` — The chart that the event/callback occurred [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/Chart/index.md)
- `public bool CtrlKey {get;}` — True if Ctrl key was pressed otherwise False [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/CtrlKey/index.md)
- `public Key Key {get;}` — Keyboard key [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/Key/index.md)
- `public ModifierKeys Modifiers {get;}` — Modifiers key that was used with the Key [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/Modifiers/index.md)
- `public bool ShiftKey {get;}` — True if Shift key was pressed otherwise False [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartKeyboardEventArgs/ShiftKey/index.md)

