Jump to content

Run script when key is pressed?


Recommended Posts

Hi, I was trying to get scripts to run when one of the keys on the keyboard is hit.

MouseClick ( "left" )

sleep(500)

MouseClick ( "left" )

This one is for emulating a double click, giving the mouse finger an alternative means. I compiled this into an exe and it causes the mouse to double click but how to "tie" a keyboard button to it.

Edited by cubancigar
Link to comment
Share on other sites

HotKeySet("{NUMPAD0}", "goonce")

HotKeySet("{NUMPAD1}", "goinspace")

HotKeySet("{ESC}", "Terminate")

$going = True

While 1

Sleep(100)

WEnd

Func goonce()

MouseClick("left")

Sleep(500)

MouseClick("left")

EndFunc ;==>goonce

Func goinspace()

$going = True

While 1

MouseClick("left")

Sleep(500)

if not $going then exitloop

MouseClick("left")

Sleep(500)

if not $going then exitloop

WEnd

EndFunc ;==>goinspace

Func Terminate()

$going = False

EndFunc

This one will double click once when keypad 0 is pressed. When keypad1 is hit it will go into a cycle of clicking untill you hit escape which resets it. I love you autoit, wtf have i been doing all these years.

Now hopefully this thing works in linux

Edited by cubancigar
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...