Bug Report AHK not working with OBS Studio

Xlizardhead

New Member
Hello, OBS newest updates has caused AutoHotKey to stop registering commands. Any idea??

F3::
MsgBox, 0, Test, This MsgBox will go away in 2 seconds., 2
controlSend,,{F4},ahk_exe obs64.exe
; recording shortcut
Return

Downgrading to OBS-Studio-19.0.1-Full-Installer.exe is the only solution.
 

TSForrest

New Member
Still an issue. I really hope the OBS Project folks do something to allow AHK to send keystrokes directly to the OBS window, again. That's the only way I know to use hotkeys in OBS that use CTRL, SHIFT, ALT, etc, which are keybinds used in almost every game I play. So, it's either rebind all those keys to hard-to-reach keys... in EVERY game, or don't use CTRL ALT or SHIFT as parts of hotkeys in OBS. OBS also broke numbers being used in hotkeys in OBS, so now we have very few hotkeys to use that don't lead to some kind of trouble. AutoHotKey was a GREAT way around this problem, but not since OBS changed something that broke the ability for AHK to send the keystrokes directly to OBS.
 

carlmmii

Active Member
Key commands sent from AHK need to be sent with a timing hold for OBS to catch them.
Code:
Send {F22 Down}
Sleep, 50
Send {F22 Up}

Also, if OBS is run in administrator mode, the AHK script must also be run in administrator mode.
 

Asdren

New Member
Key commands sent from AHK need to be sent with a timing hold for OBS to catch them.
Code:
Send {F22 Down}
Sleep, 50
Send {F22 Up}

Also, if OBS is run in administrator mode, the AHK script must also be run in administrator mode.

This was super helpfull. Thank you!!
 

Moench

New Member
Doesnt work for me if OBS is not the active window :( ControlSend only work if the window is active. And thats never the case because there is always a game in foreground
 

Yuji

New Member
Doesnt work for me if OBS is not the active window :( ControlSend only work if the window is active. And thats never the case because there is always a game in foreground
Did u get it working when obs isnt the window active?
 

koala

Active Member
As far as I remember, there are 2 methods of sending keystrokes:
Send: this sends keystrokes to the active window. Useless if the app is in background such as OBS with a game as active window.
ControlSend: this sends keystrokes directly to a window control. As far as I remember, directly sending to a control stops working as soon as the window isn't the active window any more. However, it's possible with ControlSend to send a keystroke to the parent window of the given control, and this seems to work if the window is in background.

So this should work for example to send an ESC key to OBS, if you stored the window id of OBS to %obs%:

ControlSend, ahk_parent, {ESC}, ahk_id %obs%

Also see the Winamp example from the autohotkey documentation: https://www.autohotkey.com/docs/misc/Winamp.htm
 

Yuji

New Member
As far as I remember, there are 2 methods of sending keystrokes:
Send: this sends keystrokes to the active window. Useless if the app is in background such as OBS with a game as active window.
ControlSend: this sends keystrokes directly to a window control. As far as I remember, directly sending to a control stops working as soon as the window isn't the active window any more. However, it's possible with ControlSend to send a keystroke to the parent window of the given control, and this seems to work if the window is in background.

So this should work for example to send an ESC key to OBS, if you stored the window id of OBS to %obs%:

ControlSend, ahk_parent, {ESC}, ahk_id %obs%

Also see the Winamp example from the autohotkey documentation: https://www.autohotkey.com/docs/misc/Winamp.htm
I'm not too smart to make a script, how much will you charge me just to write one that press the Z letter every 5 minutes even when obs isn't the window?
 

Yuji

New Member
As far as I remember, there are 2 methods of sending keystrokes:
Send: this sends keystrokes to the active window. Useless if the app is in background such as OBS with a game as active window.
ControlSend: this sends keystrokes directly to a window control. As far as I remember, directly sending to a control stops working as soon as the window isn't the active window any more. However, it's possible with ControlSend to send a keystroke to the parent window of the given control, and this seems to work if the window is in background.

So this should work for example to send an ESC key to OBS, if you stored the window id of OBS to %obs%:

ControlSend, ahk_parent, {ESC}, ahk_id %obs%

Also see the Winamp example from the autohotkey documentation: https://www.autohotkey.com/docs/misc/Winamp.htm
nvm i got it working and this is what i used
#Persistent
SetTimer,PressTheKey,3000
Return

PressTheKey:
controlSend,,{z},ahk_exe obs64.exe
SetKeyDelay 50, 50
Return
 
Top