mg

Author: Learning one Last Modified: nonexistent


Mouse gestures are specific mouse movements which can be recognized by this module.
Gestures recognition system recognizes 4 basic mouse movements: up, down, right, left.

- completely in function form
- easy to use, understand, implement in your script
- documentation + all functions < 160 lines
- does not require additional function libraries

MG_GetAngle(StartX, StartY, EndX, EndY)
MG_GetMove(Angle)
MG_GetRadius(StartX, StartY, EndX, EndY)
MG_Recognize(MGHotkey="", ToolTip=0, MaxMoves=3, ExecuteMGFunction=1, SendIfNoDrag=1)

For the functions's parameters and return value, please see it's source code.

Remarks

It does lacks an external documentation. Look for that at head of source.

For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/viewtopic.php?t=56472

License

The functions is an open source item under the free non commercial license.
For details, please see Learningone_mg-license.txt

Example

; #Include mg.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

MsgBox Hold right mouse button and make movements up to four different directions and release that button. If a gesture was recognized, it should show it code.`n`nThe middle mouse button calls predefined functions.

; Example 1: store gesture in variable and show it in MsgBox if it isn't blank or zero.

RButton::
Gesture := MG_Recognize()
if Gesture
MsgBox,,, %Gesture%, 1
Return

; Example 2: execute existing MG function

MButton::MG_Recognize()

MG_R()   {
MsgBox,,, %A_ThisFunc%, 1
}

MG_RD()   {
MsgBox,,, %A_ThisFunc%, 1
}

MG_RDL()   {
MsgBox,,, %A_ThisFunc%, 1
}