IAmTheManYo Posted October 27, 2006 Share Posted October 27, 2006 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. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted October 27, 2006 Share Posted October 27, 2006 since your a noob ill show u an example #include <misc.au3> HotKeySet("{ESC}","quit") While 1 Sleep(25) If _IsPressed("04") Then Send("hello") EndIf WEnd Func quit() Exit EndFunc Link to comment Share on other sites More sharing options...
IAmTheManYo Posted October 27, 2006 Author Share Posted October 27, 2006 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. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted October 27, 2006 Share Posted October 27, 2006 (edited) out of my ass hahah no from the beta help file , seems as if you are understanding the commands thats good Edited October 27, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
IAmTheManYo Posted October 27, 2006 Author Share Posted October 27, 2006 Found it. ^^ Ty I love you. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted October 27, 2006 Share Posted October 27, 2006 Found it. ^^ Ty I love you.lil akward hahah remember the help is your friend Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now