OK, here is a new challenge, what I'd like to implement is this set of actions:
1) right mouse button held down, mouse moving: trigger gesture;
2) RMB held down, mouse still:
2a) if wheel scrolls Up or Down then increase or decrease volume;
2b) if nothing happens for 400ms then trigger task manager.
All this stuff shoule be compatible with existing Accellerated Scrolling instructions already in place:
Code:
~$WheelUp::
~$WheelDown::
if (A_PriorHotkey = A_ThisHotkey && (G_TimeSincePriorHotkey := A_TimeSincePriorHotkey) < G_Timeout)
{ ; if it's the same hotkey and in the timeframe we want
StringTrimLeft,G_ThisHotkey,A_ThisHotkey,2 ; remove ~$ from the string of the hotkey
MouseClick,%G_ThisHotkey%,,,(G_Timeout - G_TimeSincePriorHotkey)*G_limit//G_Timeout
}
Return
This is my partial, incomplete, not working try:
Code:
mgr_MonitorRButton()
{ ; Monitor the mouse right button
mgr_MonitorRButton:
MouseGetPos, mX1, mY1
While GetKeyState("RButton", "P"){
Sleep, 10
MouseGetPos, mX2, mY2
If (Abs(mX2-mX1)>5 || Abs(mY2-mY1)>5)
{
If ( Gesture := mgr_MonitorGesture() )
If ( Command := mgr_GetCommand(Gesture) )
SendInput, %Command%
ToolTip
Return
}
If (Abs(mX2-mX1)<5 AND Abs(mY2-mY1)<5 AND WheelUp=1)
{
Send {Volume_Up}
Return
}
If (Abs(mX2-mX1)<5 AND Abs(mY2-mY1)<5 AND WheelDown=1)
{
Send {Volume_Down}
Return
}
If (Abs(mX2-mX1)<5 AND Abs(mY2-mY1)<5 AND A_TimeSinceThisHotkey>400 AND WheelUp!=1 AND WheelDown!=1)
{
MouseMove, 720, 610
Send ^!{Tab}
KeyWait, RButton
Sleep, 10
Send {LButton}
Return
}
}
SendInput, % mgr_GetModifiers() "{RButton}"
Return
}
I know I'm making the right-button pretty busy, but you know what: if I have my hand over there why move it?
Cheers! ^__^