# Shortcuts / hotkeys for online web docks



## PetitJabanes (Feb 17, 2021)

Hi, I've developed a dynamic lower third consisting of a control panel to be used as a dock and a "receiver page" to be used as a browser source / overlay. The two communicate via Broadcast Channels in javascript. I've also implemented basic hotkey functionalities in javascript in the control panel page but, as soon as this window is not "in focus" (I've clicked elsewhere in the program) the hotkey triggers no longer work (understandingly). So, I wanted to use a LUA script to add hotkeys to OBS, as I've seen done on other projects but, my control panel and receiver window are hosted online (mainly because they run PHP) instead of locally, ergo I'm having trouble...

What I've seen done : a LUA script updates a local file, the file is read by a locally hosted web page (in html), the page triggers some action.
The thing is, in my case : the online page cannot read local files and the local LUA script in OBS can't talk to the distant web page in javascript (at least I don't know how to). I've tried passing the data from LUA to my web page via cookies, but they are encrypted, hence impossible to read or modify.

Can a LUA script somehow connect / send data through the js Broadcast Channels? How can I define "global" hotkeys to be registered my control panel dock?

The ultimate goal is to have the lower third show up by pushing a button on an Elgato Stream Deck.
Perhaps I'm going at it from the wrong angle...


----------



## upgradeQ (Feb 17, 2021)

There is a method called `obs_source_send_key_click` which let's you send a hotkey combination to a browser source. I've commented on obs-browser issues about it.


----------



## mariah1902 (Feb 17, 2021)

upgradeQ said:


> There is a method called `obs_source_send_key_click` which let's you send a hotkey combination to a browser source. I've commented on obs-browser issues about it.


I have tried your method but it did not work. What to do now?.


----------



## dodgepong (Feb 17, 2021)

I feel like using OBS hotkeys is a red herring if you ultimately want to control your overlays with a Stream Deck. I would instead look into figuring out how to get the Stream Deck to send HTTP requests on button pushes to an API on your overlay web server.


----------



## upgradeQ (Feb 18, 2021)

mariah1902 said:


> I have tried your method but it did not work. What to do now?.


Please provide more details, what exactly is not working ? Clarify. Did you followed instructions from this link?








						[Request] Add proc handlers to source's public API for scripting · Issue #140 · obsproject/obs-browser
					

I would like to script a browser source, specifically I would love to call the source's Refresh() method from a Python OBS script. Adding proc handlers for the browser source's public metho...




					github.com


----------



## Maxter-by (Feb 18, 2021)

I have the same problem, how can I send hotkey or to dock panel, wich is not locally hosted.


----------



## mariah1902 (Feb 19, 2021)

upgradeQ said:


> Please provide more details, what exactly is not working ? Clarify. Did you followed instructions from this link?
> 
> 
> 
> ...


Yes I have followed the instruction from this link and it did not work. The obs source send key link is not working for me. Other people seems like getting the solution for what they are suffering but I am not. I have followed exactly what the link told me to do but nothing happened. I still have the same problem.


----------



## upgradeQ (Mar 1, 2021)

mariah1902 said:


> Yes I have followed the instruction from this link and it did not work. The obs source send key link is not working for me. Other people seems like getting the solution for what they are suffering but I am not. I have followed exactly what the link told me to do but nothing happened. I still have the same problem.


Turns out I did not test it on real websites, now it should work ( platform GNU/Linux Ubuntu 18.04).


----------



## alorimer (Aug 24, 2021)

Any updates on hotkeys for browser docks? The `obs_source_send_key_click()` method is great for browser sources, but there's no equivalent for browser docks. I've posted a new thread here asking about browser docks in specific.


----------

