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
hotkeyNamestringName of the hotkey to trigger.
contextNamestringName of context of the hotkey to trigger.
cancellationTokenCancellationTokenA 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
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.