Page 1 of 1

ControlClick with CTRL KEY DOWN

Posted: 16 Sep 2019, 00:33
by danielfgpontes
Hello all.

I'm trying to make a script that send the CTRL key down, in a background window, then send a ControlClick(With CTRL down) then release the CTRL key, I've tried this:

Code: Select all

ControlSend, {Ctrl Down}, ahk_id %CO_id%
ControlClick, x909 y252, ahk_id %CO_id%,, left
ControlSend, {Ctrl Up}, ahk_id %CO_id%
But the CTRL key doesn't go down, only the click work

If I try this:

Code: Select all

ControlSend, {Ctrl Down}, ahk_id %CO_id%
Sleep, 1000
ControlSend, {Ctrl Up}, ahk_id %CO_id%
The CTRL key works, but I can't find a way to work with both commands at the same time.

Re: ControlClick with CTRL KEY DOWN

Posted: 25 Sep 2019, 11:13
by YoucefHam
try this

Code: Select all

ControlSend, {Ctrl Down}, ahk_id %CO_id%
Sleep, 120
ControlClick, x909 y252, ahk_id %CO_id%,, left
Sleep, 1000
ControlSend, {Ctrl Up}, ahk_id %CO_id%