I have a bot written in Java and I have a problem with actual keyboard inputs interfering with my messages.
I'm using PostMessage thru JNA and it sends {Down} every sec. But if user presses ctrl key down before it sends it, it is treated as ctrl+down and behaves differently. I tried same thing in AHK
IfWinExist BlueStacks App Player { WinActivate Loop, 10 { Send {Down} Sleep 1000 } }
This works perfect. Even when I spam ctrl button while it is running, it does not interfere with it.
Although I tried using ControlSend since it should work on background windows, but it didn't work.(Same ControlSend in autoIT works tho)
So how does ahk do it?
I tried to read source code of ahk but it is really hard to understand what is going on without visual studio.
I tried sleeping until ctrl is up(via GetKeyState) before sending my input but that's not ideal case ofcourse. And there can still be race condition.
Does ahk use sendinput with AttachThreadInput or postmessage or blockinput or whatever