Page 1 of 1

ControlSend not sending Ctrl

Posted: 26 Jun 2019, 13:51
by sdetwiler
I'm attempting to write a script that will use SendInput when a window is active and ControlSend when it is not. Both commands should send Ctrl+j. The SendInput works but the ControlSend seems to only be sending the j and not Ctrl+j. I tried using ^j and {Ctrl Down}j{Ctrl Up} with the same result. I also tried using SetKeyDelay with each of the ahk recommendations of "10, 10", "0, 10" and "-1, 0". Does anyone have another idea I could try? I would prefer to not have to activate the window first because I usually have the program running in the background and don't want it interfering with my workflow. Here's my code as it stands right now:

f18::
if WinActive("ahk_exe Vista.exe") {
SendInput, {Ctrl Down}j{Ctrl Up}
}
else {
ControlSend,, {Ctrl Down}j{Ctrl Up}, ahk_exe Vista.exe
}
return