-
-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requests: Add hotkeys press events #595
Requests: Add hotkeys press events #595
Conversation
Adds a new request called `ProcessHotkeyByName` which calls the routine associated with a given hotkey. The hotkey is identified by the unique name set while registering it. Works with both OBS default hotkeys and hotkeys added by plugins/scripts.
Adds a new request called `ProcessHotkeyByCombination` which calls the routine associated with a given hotkey. The hotkey is identified by the combination of keys set by the user to trigger it. Multiple routines are called if the same combination is bound to different hotkeys.
Changes requests names to "TriggerHotkeyByName" and "TriggerHotkeyBySequence"
Thanks for the docs updates and the other fixes, I'll keep them in mind for future PRs We need to adjust the TriggerHotkeyBySequence/TriggerHotkeyByCombination name, we ended up using different stuff in our PRs. Feel free to update whatever you want |
@tt2468 I guess you didn't see my message before merging. New docs refer to TriggerHotkeyByCombination but the request is actually called TriggerHotkeyBySequence. You need to change either of those, whichever you prefer. Sorry for all the mess :S |
I did read your message, but didn't understand it correctly. Oops |
Description
This PR adds two new requests that allow triggering hotkeys callback functions over websocket. The hotkey can be defined either by its unique name (the one used during registration) or by specifing the combination of keys associated to trigger it. In the latter, if the same combination has been set for multiple hotkeys, all of them will be triggered.
Note: the requests are named
ProcessHotkey
and notPressHotkey
because no "physical" pressing event is sent/triggered, rather just the underlying callback functions are called/processed. Please let me know if you'd rather name the requests differently.Motivation and Context
This PR was motivated by the need to trigger script functions remotely. The requests can be easily used to trigger custom hotkeys registered within a script, and of course they also work with the default OBS hotkeys.
Related feature requests: #427, #444, #180
How Has This Been Tested?
Tested OS(s): Windows 7 SP1, Windows 10 2004 (OBS 25.0.8)
The changes were tested by sending the requests via webpage using obs-websocket-js. For
ProcessHotkeyByName
request, both OBS default hotkeys and custom hotkeys (registered within scripts) were tested. ForProcessHotkeyByCombination
request, tests were done with multiple key combinations (with and without modifiers), and associated to a single or multiple hotkey routines.Types of changes
Checklist: