Jump to content

Mouse hook example


AJ6594
 Share

Recommended Posts

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:

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...