Code: Select all
~ LButton ::; Make the left mouse button a hotkey, but allow it to function as normal.
MouseGetPos, xA, yA
loop; Looped begin.
{
duration: = 0
if (GetKeyState, LButtonState, LButton, P)
{
start: = A_TickCount
While (GetKeyState, LButtonState, LButton, P)
Sleep, 1
duration: = A_TickCount - start
}
if (duration> 100)
{
MouseGetPos, xB, yB
Transform, xA, abs,% xA%; Return the absolute value of xA.
Transform, xB, abs,% xB%
Transform, yA, abs,% yA%
Transform, yB, abs,% yB%
xDiff = 0
xDiff + =% xA%; Add xA to xDiff.
xDiff - =% xB%; Subtract xA from xDiff.
Transform, xDiff, abs,% xDiff%
yDiff = 0
yDiff + =% yA%
yDiff - =% yB%
Transform, yDiff, abs,% yDiff%
diffSum = 0
diffSum + =% xDiff%
diffSum + =% yDiff%
If diffSum> 10
{
Send, ^ c; Copy.
clipboard =% clipboard%; Convert the cliboard contents to plain text.
}
break
}
}
return
MButton ::; Make the middle mouse button a hotkey, and _don't_ allow it to function as normal.
send, ^ v; Paste
return
error at line 11
line text: while (getkeystate, lbuttonstate, lbutton, p)
error: this line does not contain a recognized action
the program will exit.
now the fact is that it seems strange that it has been spelled wrong, the author gives it to work and I have done copy and paste. What could be the cause.
note also that I have tried various other scripts of the kind and always give me similar errors namely:
: this line does not contain a recognized action
the program will exit.
when I copy the scripts I compile them with ahk2exe