Reputation: 441
Using autohotkey, I am trying to do make:
ideally the order in which the keys are pressed should not matter.
What I have at the moment is:
LCtrl & LShift::
If (A_PriorHotKey = A_ThisHotKey) ;these are built in variables
return
Send {RCtrl Down}
MouseClick, left,,, 1, 0, D ; Hold down the left mouse button.
return
LCtrl & LShift Up::
Send {RCtrl Up}
MouseClick, left,,, 1, 0, U ; Release the mouse button.
return
While pressing ^LShift does simulate pressing RCtrl & Left click, releasing ^LShift does nothing most of the time. Usually, even if I release them, RCtrl + Left click keep being "pressed" and I have to manually press them to (activate and) deactivate them.
Upvotes: 1
Views: 4624
Reputation: 10543
Try this
LCtrl & LShift::
Send {RCtrl Down}
MouseClick, left,,, 1, 0, D ; Hold down the left mouse button.
KeyWait, LCtrl ; Wait for LCtrl to be released
Send {RCtrl Up}
MouseClick, left,,, 1, 0, U ; Release the mouse button.
return
EDIT:
To make it work no matter the order in which you press the keys, try this:
LCtrl & LShift::
LShift & LCtrl::
Send {Blind}{Shift Up}
Send {RCtrl Down}
MouseClick, left,,, 1, 0, D ; Hold down the left mouse button.
KeyWait, LCtrl ; Wait for LCtrl to be released
Send {RCtrl Up}
MouseClick, left,,, 1, 0, U ; Release the mouse button.
return
Upvotes: 4