Jump to content
Sign in to follow this  

Noob In Need Of Help

Recommended Posts

I'm new to Autoit and was wondering how one would make a script that sends a key everytime I press the middle mouse button.

For example,

When I press the middle mouse button I want the script to send the word "Hello" into the active window.

Share this post

Link to post
Share on other sites

This seems to do the trick but I still don't understand it much. What I understand so far is.

#include <misc.au3> is for using the IsPressed fuction that it has.

HotKeySet is used to make ESC call the fuction "quit" Ex. Esc closes the program.

While is the loop

Sleep(25) is necessary to keep your processor from spazzing as it tries to run the loop 100x a second

If_IsPressed("04") is the trigger which detects the keypress, then does whatever

Func quit() is the fuction that exits the script when esc is pressed.

That's about it right?

However I don't know where the "04" part of If_IsPressed is coming from. "04" = The middle mouse button? and if so where did you get this value?

Thanks for the help btw. :whistle:

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  

  • Create New...