I'm trying to write a basic mouse gestures with wheel support, and as a beginner, I don't manager to find the right way to do it.
Code: Select all
#IfWinActive ahk_class Chrome_WidgetWin_1
RButton::
{
MouseGetPos PL1, PL2
Send {RButton down}
return
}
RButton Up::
{
MouseGetPos PL3, PL4
if (abs(PL4-PL2)>300)
{
if (PL4>PL2)
{
Send ^r
return
}
if (PL4<PL2)
{
return
}
}
if (abs(PL3-PL1)>100)
{
if (PL3>PL1)
{
Send ^+t
return
}
if (PL3<PL1)
{
Send ^w
return
}
}
Send {RButton}
return
}
Plus when I try to integrate mousewheel support, I cannot, since GetKeyState, PLR2, RButton always result in "U" state.
I've tried to read some mouse gestures scripts but they are too complicated for me.
What is the best way to do stuff when Rbutton is down ? And when RButton is up, I'd like either it fires the normal contextual menu, either it fires another event without breaking right click (like if RButton got stuck in "D" state).
If someone can give me some clues, I'd really like to understand it.