Jump to content

Please, help, i cant do Left mouse click to start a function.


Recommended Posts

Hi to all.

This forum is anwsome!

Please, can you help me with this function below:

HotKeySet("{INSERT}", "sprint")

$sprint=False

Func sprint()

If($sprint)Then

Send("{PGDN up}")

Else

Send("{PGDN down}")

EndIf

$sprint = Not $sprint

EndFunc

But in place of INSERT, i need put a left mouse click.

I tried this:

While 1

Sleep ( 250 )

If _IsPressed("01", $dll) Then

Send("{PGDN up}")

Else

Send("{PGDN down}")

EndIf

WEnd

But dont work too...

Can anyone help me?

Sorry for my english, is not my first lenguage.

Link to comment
Share on other sites

This seems to work unless it is not what you intended.

#Include <Misc.au3>
$sprint=False
While 1
If _IsPressed(01) then sprint()
Sleep (100)
WEnd
Func sprint()
If $sprint Then
Send("{PGDN up}")
MsgBox(0, '', 'Up', 2)
Else
Send("{PGDN down}")
MsgBox(0, '', 'Down', 2)
EndIf
$sprint = Not $sprint
EndFunc

JoHanatCent, thank you very much! :)

Now works like a charm!

Now im trying understand what you do diferent of me.

Thank you friend!

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...