Sign in to follow this  
Followers 0
AJ6594

Mouse hook example

5 posts in this topic

I found this code in another forum...

#InstallMouseHook

LButton::

CoordMode, Mouse, Screen

GetKeyState, LBState, LButton

if (LBState <> D)

{

MouseGetPos,xpos, ypos

MouseClick, left,,,,,D

MouseMove, %xpos%, %ypos%, 0

MouseClick, left,,,,,U

}

else

{

MouseClick, left,,,,,D

}

return

LButton & RButton::

MouseClick, Left,,,,,D

return

RButton::

Mouseclick, Right

return

return

================================================

But it is returning an error :

ERROR: syntax error (illegal character)

LButton:

Share this post


Link to post
Share on other sites



try converting it to autoit.

I just tried and failed using the converter found in the extras folder.

Can somebody please convert this simple script for me ?

ty in advance.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I just tried and failed using the converter found in the extras folder.

Can somebody please convert this simple script for me ?

ty in advance.

Would be better if you made an attempt yourself... and when posting code in the AutoIt support forum, try posting AutoIt code and not AHK code.

http://www.autoitscript.com/autoit3/docs/f...ItSetOption.htm

http://www.autoitscript.com/autoit3/docs/f...MouseGetPos.htm

http://www.autoitscript.com/autoit3/docs/f.../MouseClick.htm

Help file: _IsPressed()

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0