---
id: "T:cAlgo.API.HotkeyArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Hotkeys/HotkeyArgs/"
---

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

# HotkeyArgs (class)

Provides data for Plugin Hotkeys handler.

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.

## Definition

```csharp
public class HotkeyArgs
```

Available since cAlgo.API 5.4.

## Examples

C#:

```csharp
protected override void OnStart()
{
    Hotkeys.TryAdd(Key.S, ModifierKeys.Control | ModifierKeys.Shift, OnHotkey);
}

private void OnHotkey(HotkeyArgs args)
{
    Print("Hotkey pressed: {0} + {1}", args.Modifiers, args.Key);
}
```

Python:

```python
from System import Action

def on_start(self):
    api.Hotkeys.TryAdd(Key.S, ModifierKeys.Control | ModifierKeys.Shift, Action[HotkeyArgs](self.on_hotkey))

def on_hotkey(self, args):
    api.Print(f"Hotkey pressed: {args.Modifiers} + {args.Key}")
```

## Properties

- `public Key Key {get;}` — Keyboard key [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Hotkeys/HotkeyArgs/Key/index.md)
- `public ModifierKeys Modifiers {get;}` — Modifiers key that was used with the Key [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Hotkeys/HotkeyArgs/Modifiers/index.md)

