ControlSend not sending Ctrl

Get help with using AutoHotkey and its commands and hotkeys
sdetwiler
Posts: 1
Joined: 30 May 2019, 14:27

ControlSend not sending Ctrl

26 Jun 2019, 13:51

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

Return to “Ask For Help”

Who is online

Users browsing this forum: DMDComposer, thenomad, vsub and 182 guests