Originally I wanted to make a hotkey like this
Code:
+MButton::
Keywait, Mbutton
MouseClick, Left
return
but I didn't want the left click to be a shift-left click if I was still holding down shift. When I tested some solutions I came across something puzzling. The following two scripts should work the same but they don't.
Code:
+MButton::
Keywait, MButton
BlockInput, On
Send, {Shift up}
GetKeyState, state, Shift
BlockInput, Off
Msgbox, %state%
return
Code:
+MButton::
Keywait, MButton
BlockInput, On
Send, {Shift up}
Send, {Shift up}
Send, {Shift up}
Send, {Shift up}
Send, {Shift up}
Send, {Shift up}
GetKeyState, state, Shift
BlockInput, Off
Msgbox, %state%
return
The first script is unreliable, *if* there are other hotkeys that use Shift (e.g. add a +1::a to the script to make it fail occasionally). Sometimes the script will say GetKeyState says Shift wasn't held down and sometimes it says it was. In fact, it would appear that how long you hold down Middle Mouse determines whether or not it returns U or D. The second script so far seems to consistenly work.
Any idea what is going on here, and is there a more elegant method to fix the original hotkey without using a bunch of Send, {Shift up}'s?