Skip to content

Plugin.Hotkeys

property · Plugin · cAlgo.API Since 5.4

DesktopCLICloud

Provides access to hotkeys API.

Environment behaviour

CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.

Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.

Definition

public Hotkeys Hotkeys {get;}
api.Hotkeys: Hotkeys

Returns Hotkeys

Examples

var isAdded = Hotkeys.TryAdd(Key.B, ModifierKeys.Control, args => Print("Hotkey {0}+{1} pressed", args.Modifiers, args.Key));
Print("Hotkey added: {0}", isAdded);
from System import Action
isAdded = api.Hotkeys.TryAdd(Key.B, ModifierKeys.Control, Action[HotkeyArgs](lambda args: api.Print(f"Hotkey {args.Modifiers}+{args.Key} pressed")))
api.Print(f"Hotkey added: {isAdded}")