Skip to content

HotkeyArgs

class cAlgo.API Since 5.4

DesktopCLICloud

Provides data for Plugin Hotkeys handler.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

public class HotkeyArgs

Namespace: cAlgo.API · Group: Hotkeys

Examples

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);
}
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

Name Description
KeyDesktopCLICloudKey Keyboard key
ModifiersDesktopCLICloudModifierKeys Modifiers key that was used with the Key

See also