Table of Contents

Method TriggerHotkeyByName

Namespace
OBSStudioClient
Assembly
OBSClient.dll

TriggerHotkeyByName(string, string?, CancellationToken)

Triggers a hotkey using its name. See GetHotkeyList.

public Task TriggerHotkeyByName(string hotkeyName, string? contextName = null, CancellationToken cancellationToken = default)

Parameters

hotkeyName string

Name of the hotkey to trigger.

contextName string

Name of context of the hotkey to trigger.

cancellationToken CancellationToken

A token that ends the wait for the response, which makes the method throw an OperationCanceledException. A request that was already sent is not undone: OBS Studio may still carry it out.

Returns

Task

Remarks

Note: Hotkey functionality in obs-websocket comes as-is, and we do not guarantee support if things are broken. In 9/10 usages of hotkey requests, there exists a better, more reliable method via other requests.