sisiws Posted May 17, 2010 Share Posted May 17, 2010 (edited) hi im new to autoit and need help send ("{x down}") sleep (2000) send ("{x up}") when i execute that script the x are not been hold down why? in notepad it should be like this xxxxxxxxxxxx cause i hold the key down for 2000 using sleep command instead i only get one x only..im not trying to send x 10x..what i want is to make the key hold down work.. sorry for my bad english Edited May 17, 2010 by sisiws Link to comment Share on other sites More sharing options...
JohnOne Posted May 17, 2010 Share Posted May 17, 2010 Because you are sending the keydown message and then you are sleeping which is a function itself. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Kealper Posted May 18, 2010 Share Posted May 18, 2010 This should do what you need, it will just press x continually for 2 seconds. $TimeStamp = TimerInit() ;Create timestamp While TimerDiff($TimeStamp) < 2000 ;While the timestamp is less than 2 seconds old, do this Send("x") WEnd Send("{x down/up}") is for use with key combinations, so stuff like Send("{x down}y{x up}") would be like holding x and pressing y, then releasing both. Link to comment Share on other sites More sharing options...
sisiws Posted May 18, 2010 Author Share Posted May 18, 2010 thanks now i got a clue how it works 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