How to Send OBSWebsocket Messages to "Listening" Javascript

I have developed a "streamdeck" type of browser page that I have docked in OBS.
It has HTML/CSS/Javascript code with buttons defined that recognize when the button is clicked with the mouse, and sends an OBSWebsocket hotkey event to activate an action in OBS.

I also have an AutoHotKey script that runs in the background, and recognizes a user keystroke, which then also will trigger the same button and OBSWebsocket hotkey event.

So in a nutshell, the user can either click the button with a mouse, or press a hotkey, and the HTML/CSS effects trigger, and also the OBS action is triggered.

But, my IT dept has outlawed AutoHotkey, because it can "modifiy registry entries, and sys internals".

I am trying to figure out how to do something with the Websocket feature within Advanced Scene Switcher, to send a message to Javascript, and trigger action that way. I was also thinking somehow a Lua script could help, but I am at a loss.

I am finding it hard to figure out how to formulate a proper message to be sent via OBSWebsocket, so Javascript that is "listening" for a message -- and I need to figure out how to set up the code to properly "listen" as well.

Any ideas?
 
I don't understand the hotkey design. Instead of issuing an obs request to invoke a hotkey action (assigned to some obs function), just issue an obs request to invoke the desired function. For example, suppose you want to change the program scene. Instead of assigning the scene to a hotkey and then issuing "TriggerHotkeyByName", issue "setCurrentProgramScene". OBS websockets supports requests for almost all all obs actions.
 
Back
Top