I tested some code and I came to this conclusion.
You should avoid using alt key cause (you can test it) it will cause to disappear the right click menu (right click in desktop without any ahk app running. then press alt, you see that the menu disappears.)
So here I use the Ctrl key.
The only thing you had to add was a $
prefix. same as below:
$^1::
send, {lbutton down}
keywait, 1
send, {lbutton up}
return
$^2::
send, {rbutton down}
keywait, 2
send, {rbutton up}
return
Its with Ctrl
key and you can not use Alt
key cause it disables the flying out menu. You can use !
alt key instead of ctrl key but you have to first release alt
then release 2
to prevent that menu from disappearing.
I think what you want is something like this. I figured out why it was sending repetitively and took care of it. but it does not work either. maybe the alt key is autosending itself (i mean naturally its behavior is like this).
$ALT::
send, {alt down}
keywait, ALT
return
$ALT UP::
send, {alt up}
return
$!1::
send, {lbutton down}
keywait, 1
send, {lbutton up}
return
$!2::
send, {rbutton down}
keywait, 2
send, {rbutton up}
return
Another Solution is to use a key in place of the modifier:
$1::
if GetKeyState("z", "p") {
send, {lbutton down}
keywait, 1
send, {lbutton up}
}
else {
SetKeyDelay, -1
Send {Blind}{1 DownTemp}
}
return
$1 up::
SetKeyDelay, -1
Send {Blind}{1 Up}
return
$2::
if GetKeyState("z", "p") {
send, {rbutton down}
keywait, 2
send, {rbutton up}
}
else {
SetKeyDelay, -1
Send {Blind}{2 DownTemp}
}
return
$2 up::
SetKeyDelay, -1
Send {Blind}{2 Up}
return
you can use any key instead of "z"
. z
is like the alt
key.