awp123 Posted April 18, 2013 Share Posted April 18, 2013 (edited) How can i press keyboard any key ?HotKeySet ("g") is it true ?First time , i am using autoit, and i don't know c++ , i am noob, sory it #include <ImageSearch.au3> HotKeySet("{ESC}", "Terminate") $x = 0 $y = 0 While 1 $res1 = _imagesearch('u.png',0, $x, $y, 0) If $res1 = 1 Then MouseMove($x, $y,10) HotKeySet ("g") EndIf WEnd Func Terminate() Exit 0 EndFunc Edited April 18, 2013 by awp123 Link to comment Share on other sites More sharing options...
MouseSpotter Posted April 18, 2013 Share Posted April 18, 2013 HotKeySet receives a keypress. I beleive you want to send a keypress. SEND sends keys to the active window. CONTROLSEND sends keys to a specific control of a window. Link to comment Share on other sites More sharing options...
awp123 Posted April 19, 2013 Author Share Posted April 19, 2013 Yes , it worked thanks.i have another question, can you help me ?How can i add position for image search ?ex: http://www.autoitscript.com/autoit3/docs/functions/PixelSearch.htm Link to comment Share on other sites More sharing options...
MouseSpotter Posted April 19, 2013 Share Posted April 19, 2013 ControlGetPos will return the position & size of the control (x,y,width and height) 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