Question / Help AutoHotkey Conflict

FrankieNBloo

New Member
I know autohotkey can be spotty with OBS (at least that is what I've heard). Yet, until recently, I was able to use autohotkey with OBS perfectly fine. I have no idea why it randomly and suddenly stopped working (I didn't change my script at all), but I think I've isolated what might be the cause. I'm looking for any advice from anyone who has found a workaround.

I think it has something to do with the game capture source. Whenever I have a game running as an active window, the moment I press any keys on the keyboard, the ahk script stops sending my hotstrings to my system. I can click in the game window all I wish and the script continues to work. Yet the moment I hit any keys on my keyboard while the game is the active window, the script stops functioning. Sometimes ahk even closes itself once i close a game window - it shouldn't do this. There is nothing in the script which would say it should do this. There are no ifwin commands or winactivate commands at all in the script or anything of the sort. I just have a manual ctrl+esc hotkey to exit the script. It's pretty simplistic and it was working perfectly fine with obs and obs's game capture until recently where it stopped functioning out-of-the-blue. Originally, I thought it was because of a priority issue (you cannot use ahk, to my knowledge, if you try and run OBS in administrator mode for example). So I tried to bump up ahk's priority in the task manager, but that didn't work. But I think it has to do with the game capture source.

I do currently have a workaround for this, but it's a manual one, and the goal for me is to make my OBS hotkeys more automated even further through the use of AHK.

Also my GTX 1070 driver crashed while trying to fix this when putting dota2 from fullscreen to windowed - I was trying to test other games. And now my desktop icons are always scattered all over the place on startup, and I'm most likely going to have to do a factory reset of the windows OS to reset them. Long story short, I'm fed up and want to ask anyone here for suggestions.

So does anyone have any suggestions or workarounds for getting AHK to reliably work with OBS hotkeys?
 

FrankieNBloo

New Member
POSSIBLE SOLUTION: So I think I discovered the problem and the solution.

I did further testing, and I think it has something to do with my actual hotkey setup. I'm using hotstrings, and not hotkeys. The reason for this is so that I can have virtually an infinite set of host hotkeys that I can use to activate my AHK script. The issue with this is, after pressing a button on my macro keyboard, it will spell out the hotstring command I want, then a conflict occurs.

The original problem was, (as I once thought), the moment I press any keyboard keys into a game I'm playing, the hotkey script will stop functioning until i click on a new window or the desktop. I then found out, once i press any keys in THAT new window (the game being minimized/not active; the new window/desktop is now active), the hotstring ALSO stops functioning - that was a messy sentence, but the point is my problem has no association to the game capture, or games being played in general. It has everything to do with me using hotstrings instead of actual hotkeys.

So I opened up notepad to test out the hotstrings. As expected, once notepad became active (and i didn't press any buttons on the keyboard) the script worked. However, once I began hitting keys on the keyboard (i.e. letters being typed), THEN hit my macro hotkey, it spells out the macro, but DOES NOT ACTIVATE the macro BECAUSE the hotstring couldn't recognize the macro command, since it was tied to the keyclicks before it! (i.e. it looked something like this: adsfewoero[hotstring], so it didn't recognize it.) If you do the SAME THING, but put a space before you activate the macro, the macro works perfectly! (i.e. afweoeiern [hotstring])

Next I tested it in something other than notepad, remembering to add a space before activating the hotstring, and BAM it worked!

So I think the problem is offically solved. I just need to include a command to tell AHK to recognize the command even in nested text (or hit spacebar before i hit my macro keys).
 
Top