Hi all,
I'm looking for a method to send keypresses to a browser dock when it's not focused. I have an HTTP interface in a browser dock which I would like to control with keyboard shortcuts even when the dock isn't focused. Ideally this would all be done from a Python script, but it looks like that will need work on the API to make it possible.
Some context: I have written a Python program to control a PowerPoint slideshow with an HTTP/WebSocket interface. The intention is that I can add a browser dock in OBS to show the locally-hosted HTTP interface and control the slideshow from within OBS. This works fine, and in fact I've been using this system for about 6 months. However, the keyboard shortcuts I implemented in the interface only work when the browser dock is focused in OBS, and as soon as I click out of the dock the keyboard shortcuts don't work (see Shortcuts / hotkeys for online web docks).
To get around this, I have been using a separate Python script in OBS which takes in hotkey events and sends commands to the backend directly over WebSocket. This works alright, but I'd like the hotkeys to be able to control over HTTP interface directly, rather than running both the HTTP client and the OBS script in parallel.
The simplest way to fix this seems to be a script which registers hotkeys with OBS as usual, and when a certain key is pressed, it calls a method on the browser dock to send a key, like these snippets for browser sources which use
Another option I thought of is somehow using the CEF devtools (activated by the
Any ideas?
I'm looking for a method to send keypresses to a browser dock when it's not focused. I have an HTTP interface in a browser dock which I would like to control with keyboard shortcuts even when the dock isn't focused. Ideally this would all be done from a Python script, but it looks like that will need work on the API to make it possible.
Some context: I have written a Python program to control a PowerPoint slideshow with an HTTP/WebSocket interface. The intention is that I can add a browser dock in OBS to show the locally-hosted HTTP interface and control the slideshow from within OBS. This works fine, and in fact I've been using this system for about 6 months. However, the keyboard shortcuts I implemented in the interface only work when the browser dock is focused in OBS, and as soon as I click out of the dock the keyboard shortcuts don't work (see Shortcuts / hotkeys for online web docks).
To get around this, I have been using a separate Python script in OBS which takes in hotkey events and sends commands to the backend directly over WebSocket. This works alright, but I'd like the hotkeys to be able to control over HTTP interface directly, rather than running both the HTTP client and the OBS script in parallel.
The simplest way to fix this seems to be a script which registers hotkeys with OBS as usual, and when a certain key is pressed, it calls a method on the browser dock to send a key, like these snippets for browser sources which use
send_hotkey_to_browser()
: [1] [2]. However, no such API has been written for browser docks as far as I can tell, and I'm having trouble working out exactly how I would add this to the source.Another option I thought of is somehow using the CEF devtools (activated by the
--remote-debugging-port=...
argument) to send input, since this could easily be manipulated with something like selenium. But I can't see any easy way to enable the devtools at runtime.Any ideas?