Bug Report [WORKAROUND] Hotkeys not Global (not working when OBS not active)

Rafal Lukawiecki

New Member
For what it is worth, a workaround is to create an Automator app that runs an AppleScript, and assign a button in Streamdeck to launch that app. In my case, the script is:

on run {input, parameters}
set frontmostAppPath to (path to frontmost application) as text
activate application "OBS"
tell application "System Events"
key code 111
end tell
activate application frontmostAppPath
end run

This script will remember the currently active app, then activate OBS, sends it keycode 111 which is Apple code for F12, then reactivates the previously active app so it is back in the foreground. You need to assign the given key as a Transition hot key (F12 in my case) and look up its AppleScript code (I used https://eastmanreference.com/complete-list-of-applescript-key-codes). Finally, when you try running it, you will need to give your app the permission to use System Events to send keystrokes. This has a security implication if someone were to hijack your app to do something nefarious.

In any case, this solved the problem for me but it is not very elegant. I hope that StreamDeck figure out a way to enable that important functionality directly in their app.
 

suzyblue24

New Member
I'm right there with you Rafa
None of the above suggestions have worked for me. Catalina 10.15.7.
Mine won't work either unless OBS is on focus. When I try to use my hotkeys in the VIPKid app, they won't work. I have to pull OBS to focus for them to do anything. I've made sure that "never disable hotkeys" is enabled. I've also done the supposed work around to make them global (System preferences-Security/Privacy-Input Monitoring-unlock then I hit + and add OBS directly from applications. I still have to keep OBS in focus to use hot keys. What's the point of hot keys if I can't use them for anything!! Another weird thing is that even when OBS is in focus, certain keys will NOT work as hotkeys - space bar, option and any number keys to name a few. It worked fine on my older Macbook Air. I'm using the new M1 Macbook Air.
 

Kobold

New Member
Same here, did not even see one hotkey working since I installed OBS on my Mac Mini M1. Strange that nothing is happening, no infos, no ideas for a fix, just silence. Do hotkeys work on Streamlab OBS, anyone knows?
 

Hippy Fiasco

New Member
I use a multi-action button and have the first action be "Open Application", then slight delay, then hot-key. It doesn't always work on the first press, but then will work on the second press. Not completely fail-safe, but surprised I havent heard this method mentioned.
 

Loretod

New Member
Thank you so much for this thread it very much put me in the right direction. Sadly I'm running Big Sur and getting even more permission issues despite giving full disk access and more. I found a workaround using the Accessibility panel used for alternative computer access to create a custom OBS panel that sits on top of all windows and allows me to use the AppleScripts above. The flow is as follows: create hotkeys in OBS > Create AppleScripts for the hotkeys (as discussed above) > Enable Switch Access in system preferences and navigate to panel editor (pic) > Create custom layout buttons and attach to script (pic) > Save and panel should now be visible and float above all apps for easy access (pic). You will need to allow access to Script Editor and Assistive Control.app in system preferences. I don't this will help the issues with StreamDeck though.

Screen Shot 2021-01-18 at 10.12.04 AM.png
Screen Shot 2021-01-18 at 10.12.57 AM.png
Screen Shot 2021-01-18 at 10.11.38 AM.png
 

Kobold

New Member
Why is nobody fixing this problem? No interest? No idea? May be send a few words about this problem, if it can or will get fixed?
 

simoneves

New Member
I have the problem that suddenly hot-keys from AppleScript don't work AT ALL, foreground or not. Using MIDIPipe to translate button presses on a Behringer X-Touch Mini to scene selections in OBS. I have the AppleScript doing 'tell application "System Events" to keystroke "1" using control down', and Ctrl-1 set as the hot-key in OBS. The security settings are all correct (after an earlier failure, I manually removed and re-added MIDIPipe to Security & Privacy -> Accessibility, MIDIPipe-to-OBS control is checked in Security & Privacy -> Automation, and OBS is listed in Security & Privacy -> Input Monitoring. If I change the keystroke to just "1" (without the 'using control down') the keystroke show up just fine in TextEdit and other apps. Again, THIS WAS WORKING a month ago on the same computer, and I have not updated MIDIPipe or OBS. What the heck?!

2020 MBP13 with macOS 11.2.1, MIDIPipe 1.6.1, OBS 26.1.2
 

simoneves

New Member
Solved the above, with yet another variation...

As before, if I have the MIDIPipe script generate just keystroke "1", that lands fine in any other app, but OBS with a matching hotkey does not respond. I then noticed a post way earlier in this thread which indicates that number keys don't work as OBS hotkeys anyway (although I'm sure I have had that working before).

More importantly, I noticed that when I'm in the Hotkey Editor in OBS, I can actually press the button on the X-Touch and OBS sees the event just fine to learn it, but it learns as "1 (Keypad)" instead of just "1". Even though it was able to capture that to learn it, the hotkey still did not actually do anything in normal use.

I then reverted the MIDIPipe script to send 'keystroke "1" using control down', and then in the OBS Hotkey Editor, it learns as "^1 (Keypad)" and then everything is fine.

Other earlier posts in this thread suggest that having to do an Authentication can also break things, but I have not found this to be the case.
 

CodingAlbert

New Member
The flow is as follows: create hotkeys in OBS > Create AppleScripts for the hotkeys (as discussed above) > Enable Switch Access in system preferences and navigate to panel editor (pic) > Create custom layout buttons and attach to script (pic) > Save and panel should now be visible and float above all apps for easy access (pic).

Great suggestion! I set it up in a similar manner. Just 3 important points for those who will do it the same:

1. You have to create an Apple script with a Script Editor app not an application by Automator. When you create the script do not enter: `on run {input, parameters}` as that is a line for Automator, not for the script.

2. When you set up a Switch Control,in Access Control > Switch Control > Switches, set up the one compulsory switch to some obscure key (some keys cannot be set, works with F12), so that the Switch Control app does not capture your keys by mistake. You will use the overlay software buttons, not your keyboard.

3. If you want to change your scenes in OBS while in a fullscreen app, it gets complicated. The Apple script will not return to the fullscreen app. You can add a keyboard shortcut to the Apple script pressed keys `control` + `arrow right` so that you return back to the fullscreen app (on your right)

`key code {yourhotkey, control, arrow right}`
example: `key code {119, 59, 124}`

but it is not completely reliable. Test it first.

I hope OBS figures how to fix it soon. Thanks for your help in this thread!
 

tomachi

New Member
Thank you so much for this thread it very much put me in the right direction. Sadly I'm running Big Sur and getting even ...
All of these issues are interesting. As I am running Linux and it seems to handle it pretty well. In fact I'm just using * to start and stop recording. I tried to set --> cursor but this not work. It seems to me that using MIDI would be a good way to control this app.
 

XYNNER

New Member
Hello! i Hope this would help! I'm on Windows 10 using OBS and hotkeys i made in deckboard are same with my OBS and it doesn't work.

what i did was go to your deckboard > select the hotkey and edit it > Use Multi Actions > Open editor > Add Action > Put the hotkey same as on your OBS > after that don't close the window yet at click ADD ACTION again.

that did it for me now my hotkeys connected with deckboard are functioning properly. THANKS :)
 

Attachments

  • 1.PNG
    1.PNG
    14.8 KB · Views: 93
  • 2.PNG
    2.PNG
    20.4 KB · Views: 93

BumBum

New Member
Mac OS 12.2.1 Monterey / M1Pro / Had the issue too. Driving me nuts.
Easy Fix (OBS 27.2.4)
Go to
System Prefs > Security & Privacy > Input Monitoring > (unlock) > check OBS
Hope this helps. :-)
 

lcalder

Member
I'm on iMac with latest macOS Catalina (10.15.7) and the hotkeys do work globally ... BUT ... when I send the hotkeys using Streamdeck it only works if OBS is the focused application. Not sure why Streamdeck's sending of hotkeys would vary from what my keyboard sends and to be honest I'm not sure if I should be looking at Streamdeck, OBS, or macOS to try and get this working.

Anyone have a point of view?
Same with me on MacOs Monterey 12.4 on MacBook Pro M1 Max
 
Top