Code: Select all
~LButton::
MouseGetPos, begin_x, begin_y
while GetKeyState("LButton")
{
MouseGetPos, x, y
ToolTip, % begin_x ", " begin_y "`n" Abs(begin_x-x) " x " Abs(begin_y-y)
Sleep, 10
}
ToolTip
return
(2) Dereference (*): *Expression assumes that Expression resolves to a numeric memory address; it retrieves the byte at that address as a number between 0 and 255 (0 is always retrieved if the address is 0; but any other invalid address must be avoided because it might crash the script). However, NumGet() generally performs much better when retrieving binary numbers.
--------
I found out that without "~" syntax, the code above doesn't work. And I found out that adding "*" (~*Lbutton) :: allows Lbutton inputs within multiple keystroke combination to be detected i.e. Lbutton input from Ctrl+Lbutton, Ctrl+Shift+Lbutton.
I think I only have very limited knowledge about this. Can someone help me understand the two (1) (2), from the official AHK manuals.