---
id: "P:cAlgo.API.HotkeyArgs.Key"
kind: "property"
type: "T:cAlgo.API.HotkeyArgs"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Hotkeys/HotkeyArgs/Key/"
---

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

# HotkeyArgs.Key

Member of [HotkeyArgs](https://help.ctrader.com/ctrader-algo/references/Plugin/Hotkeys/HotkeyArgs/index.md).

## Key

Keyboard key

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

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public Key Key {get;}
```

Python:

```python
hotkeyArgs.Key: Key
```

### Returns

`Key` — 

Available since cAlgo.API 5.4.

### Examples

C#:

```csharp
Hotkeys.TryAdd(Key.F2, args => Print("Key pressed: {0}", args.Key));
```

Python:

```python
from System import Action
api.Hotkeys.TryAdd(Key.F2, Action[HotkeyArgs](lambda args: api.Print(f"Key pressed: {args.Key}")))
```

