Skip to content
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

Insert OBS keypress without changing focus ? #33

Open
ghost opened this issue Mar 13, 2020 · 17 comments
Open

Insert OBS keypress without changing focus ? #33

ghost opened this issue Mar 13, 2020 · 17 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Mar 13, 2020

Is there a way to tell streamdeck to change a scene in OBS whitout changing the current window focus ?

Stealing the focus makes it useless when youre playing a game and want to switch something

@adelgado7
Copy link

I successfully got it to work by using shell scripts. For example, I have a script that has this line:

/usr/bin/wmctrl -a "OBS Studio 0" ; /usr/bin/xdotool key ctrl+alt+shift+C

This script is called by one of the buttons.

Now the prob is that the StreamDeck looses its USB connection... I can make this work once, maybe twice, then I have to exit the streamdeck app, disconnect/reconnect the deck and open the app again to make it work.

I am waiting for a new USB 3 Hub from Amazon to continue testing.

@christianparpart
Copy link

I am waiting for a new USB 3 Hub from Amazon to continue testing.

How's your "continued testing" going? I am considering moving my streaming setup completely over to Linux. For that I'd need Streamdeck to work flawlessly. Ideally without too much custom work going on. :)

MaZderMind added a commit to MaZderMind/streamdeck-ui that referenced this issue Aug 31, 2020
Very short keypresses are sometimes coalesced and by the Desktop-System and do not reach the application, when it is not in focus. This might be the reason for various hotkey-problems when the target application is not in focus: timothycrosley#47 timothycrosley#59 timothycrosley#33
@ghost
Copy link
Author

ghost commented Sep 4, 2020

I successfully got it to work by using shell scripts. For example, I have a script that has this line:

/usr/bin/wmctrl -a "OBS Studio 0" ; /usr/bin/xdotool key ctrl+alt+shift+C

This script is called by one of the buttons.

Now the prob is that the StreamDeck looses its USB connection... I can make this work once, maybe twice, then I have to exit the streamdeck app, disconnect/reconnect the deck and open the app again to make it work.

I am waiting for a new USB 3 Hub from Amazon to continue testing.

This switches focus, thus being useless when you need an active input somwhere.

@dodgyrabbit
Copy link
Collaborator

I created a fork where I added support for OBS using the obs-websocket plugin. This allows you to switch scenes in OBS without having to switch focus between windows since it's communicating using websockets between streamdeck-ui and OBS.

Also merged a bunch of other items in this fork, see the readme for details.

image

@timothycrosley
Copy link
Owner

@dodgyrabbit,

Would you be interested in making your fork the main project? And/or being the core maintainer of this repository? I currently have too many projects that I maintain, but I don't want this one to die, because I use it myself as well!

~Timothy

@dodgyrabbit
Copy link
Collaborator

dodgyrabbit commented Feb 28, 2021

Hi @timothycrosley, I'd be happy to help. Maybe let's keep it here for now and I can help get some of the PR merged and issues resolved. Will need a bit of your help to get going. How would you like to go about this? You can assign the appropriate access rights to me and I will take it from here. In order to ultimately publish new builds, you'd have to do that (PIP credentials, account etc). My first goal would be to get some of the PRs cleaned/merged and some of the issues reviewed/closed. I'll also update the docs based on my experience to make it easier for people to help with development.

BTW - I've got a couple more things waiting in the wings (core dump bug on exit, support for kasa smart switches and experimenting with drag/drop rearranging of buttons).

@tylerjw
Copy link
Collaborator

tylerjw commented Mar 17, 2021

@dodgyrabbit @timothycrosley I'm happy to help as well. I've been using the fork and would be happy to help testing PRs to get them reviewed. I don't need merge access, just saying that once @dodgyrabbit has merge access you can tag me on PRs to get an extra reviewer.

@adelgado7
Copy link

adelgado7 commented Mar 17, 2021 via email

@dodgyrabbit dodgyrabbit added the enhancement New feature or request label Mar 22, 2021
@dodgyrabbit dodgyrabbit modified the milestone: 1.0.3 Mar 26, 2021
@marcomeyerVFX
Copy link
Contributor

This switches focus, thus being useless when you need an active input somwhere.

In the meantime you could try this command as a workaround which saves the active window and resets it after running the hotkey that switches to your scene:

bash -c "actwin=$(xdotool getactivewindow); xdotool search --name '^OBS [0-9]+\.[0-9]+\.[0-9]+ \(linux\) - ' windowactivate --sync key ctrl+alt+1 && xdotool windowactivate $actwin"

@Donkula
Copy link

Donkula commented Aug 7, 2021

I created a fork where I added support for OBS using the obs-websocket plugin. This allows you to switch scenes in OBS without having to switch focus between windows since it's communicating using websockets between streamdeck-ui and OBS.

Also merged a bunch of other items in this fork, see the readme for details.

image

any update on the status of this? keep trying to find it but I have to assume it isn't available right now.

@teklynk
Copy link

teklynk commented Aug 15, 2021

This switches focus, thus being useless when you need an active input somwhere.

In the meantime you could try this command as a workaround which saves the active window and resets it after running the hotkey that switches to your scene:

bash -c "actwin=$(xdotool getactivewindow); xdotool search --name '^OBS [0-9]+\.[0-9]+\.[0-9]+ \(linux\) - ' windowactivate --sync key ctrl+alt+1 && xdotool windowactivate $actwin"

I use a similar method:

bash -c "w=`xdotool getactivewindow` && xdotool search --name '^OBS ' windowactivate --sync key ctrl+alt+shift+1 && xdotool windowactivate $w"

Though, I have noticed that I have to press the buttons twice to get it to do the thing. Anyone else have that issue or know how to solve it?

@magicoli
Copy link

I achieved this externally with obs-websockets and obs-cli (https://github.com/muesli/obs-cli), which is simpler than implementing application-specific stuff in streamdeck.

obs-cli scene switch 'My Scene'

(I had the same press twice issue with xdotool)

@ntbanks924
Copy link

I achieved this externally with obs-websockets and obs-cli (https://github.com/muesli/obs-cli), which is simpler than implementing application-specific stuff in streamdeck.

obs-cli scene switch 'My Scene'

(I had the same press twice issue with xdotool)

Hello magicoli,
can you elaborate how you got the obs-cli commands to work? I have the webhook and obs-cli installed on my Ubuntu machine but unable to trigger any command (namely the scene switcher) from the streamdeck application.

@magicoli
Copy link

I achieved this externally with obs-websockets and obs-cli (https://github.com/muesli/obs-cli), which is simpler than implementing application-specific stuff in streamdeck.
obs-cli scene switch 'My Scene'
(I had the same press twice issue with xdotool)

Hello magicoli,
can you elaborate how you got the obs-cli commands to work? I have the webhook and obs-cli installed on my Ubuntu machine but unable to trigger any command (namely the scene switcher) from the streamdeck application.

Hi Nicholas

The process was pretty straight-forward for me, so I don't know if I can be of any help.

I use Ubuntu 21.04 and OBS Studio 27.0.1

I downloaded and installed websocket package from https://github.com/Palakis/obs-websocket/releases/tag/4.9.1

`dpkg -i obs-websocket_4.9.1-1_amd64.deb`

I downloaded and installed obs-cli linux package from https://github.com/muesli/obs-cli/releases (in my case obs-cli_0.2.0_linux_amd64.deb)

`dpkg -i obs-cli_0.2.0_linux_amd64.deb`

Once done, i tried a command and it worked out of the box, like

`obs-cli source list`

(with --password=websocketpassword if authentication is set in OBS > Tools > Websocket)

I didn't figure a way to store the password yet, but maybe there is one.
I hope it helps

@ntbanks924
Copy link

ntbanks924 commented Sep 20, 2021

I must have some issue in my web socket setup then. Authentication is turned off. When I enter any command in terminal for obs-cli, i get the following:

panic: idk what kinda message this is lol

goroutine 7 [running]:
github.com/andreykaipov/goobs.(*Client).handleRawMessages(0x8906280, 0x8824580, 0x88245c0)
github.com/andreykaipov/goobs@v0.6.0/client.go:180 +0x350
github.com/andreykaipov/goobs.(*Client).handleMessages(0x8906280)
github.com/andreykaipov/goobs@v0.6.0/client.go:124 +0xc1
created by github.com/andreykaipov/goobs.New
github.com/andreykaipov/goobs@v0.6.0/client.go:72 +0x139

Thanks for the assistance though and hope I'm able to make use of this as it seems much simpler than some of the other options posted here. As I was following this project, I was certain there was discussion of merging the web socket functionality into streamdeck-ui.

Edit: I found the source of my issue. Uninstalled obs-websocket and reinstalled correct version. 5.0.X Alpha version is incompatible with OBS-CLI. Perhaps if I read things first.....

@oparada1988
Copy link

oparada1988 commented Nov 14, 2021

I created a fork where I added support for OBS using the obs-websocket plugin. This allows you to switch scenes in OBS without having to switch focus between windows since it's communicating using websockets between streamdeck-ui and OBS.
Also merged a bunch of other items in this fork, see the readme for details.
image

any update on the status of this? keep trying to find it but I have to assume it isn't available right now.

I downloaded your fork and Im missing the websocket option for the password, and the brightness slighter is even missing. I tried submitting the issue your own page but i wasnt able to.

using the obs-cli for the moment as per @magicoli suggested

Please see attached screenshot
Screenshot from 2021-11-14 12-06-45

@coolapso
Copy link

hi, this project seems to be stale and a new fork as been made with the intention of replacing this one.

if this still an issue please reopen it at: https://github.com/streamdeck-linux-gui/streamdeck-linux-gui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests