'AutoHotKey not working with OBS off-focus
I am trying to use AutoHotKey with following script:
#Persistent
SetTimer, PressTheKey, 300000
Return
PressTheKey:
Send, {Ctrl Down}{F10}{Ctrl UP}
Return
So it can send Key (Control + F10) which I have choose in OBS Hotkeys to run a media. The script is working fine while OBS is Active, but when OBS became in-active or off-focus, script won't send Ctrl+F10 to OBS.
Any solution please.
Solution 1:[1]
For sending keys to inactive windows you should use ControlSend, check here for documents, windows shouldn't be minimized.
SetTitleMatchMode, 2
#Persistent
SetTimer, PressTheKey, 300000
Return
PressTheKey:
ControlFocus,, OBS 27.2.3
Sleep, 10
ControlSend,, {LCtrl Down}{F10}{LCtrl Up}, OBS 27.2.3
Return
This might work but ControlSend doesn't work with all applications so you will need to test and find out.
SetTitleMatchMode, 2
2 is for finding the some parts of title of the windows you want to use but if there are more windows included OBS in it's name it might make problem so you can add some more parts of the window like OBS 27.0.0 or only mid part like, Profile: Streaming..etc.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

