Logjammin Posted March 17, 2009 Share Posted March 17, 2009 Hai, I'm not very good at scripting as you may be able to tell since I can't seem to figure this problem out (even with the help file and plenty of internet searching). I'm trying to use the 'SendKeyDownDelay' command to get Autoit to hold down some keys for me in a toggliing fashion for .4 seconds each. Also to Hold it down for say... 3 minutes as well. What need are just some good (multiple) examples how to use this command to this effect. Here's what I wrote in my sad unsuccessful attempt and it's toggling the keys too quick: Send("{a downdelay 400}") Sleep(50) Send("{d downdelay 400}") I know this is wrong I attempted to space them with a little "sleep" time but it didn't work either. Halp!! Link to comment Share on other sites More sharing options...
Dampe Posted March 17, 2009 Share Posted March 17, 2009 You could use Send ("{a down}") Sleep (400) Send ("{a up}") Link to comment Share on other sites More sharing options...
Logjammin Posted March 17, 2009 Author Share Posted March 17, 2009 hmm. Would that actually hold down the 'a' key for me for .4 seconds before moving onto the other key using that format? Link to comment Share on other sites More sharing options...
Authenticity Posted March 17, 2009 Share Posted March 17, 2009 I don't think so. It's just pushing the key but does not send multiple keys event or the scan code of the key as being pushed by the user. You can use this function to do that for you: Run ('Notepad') WinWaitActive('Untitled') _SendKeyDown('a', 2000, 40) Func _SendKeyDown($sKey, $iTime, $iDelay) If $sKey == "" Then Return $sKey = StringLeft($sKey, 1) Local $iTmp = Opt('SendKeyDownDelay', $iDelay) Local $iInit = TimerInit() Do Send($sKey) Until TimerDiff($iInit) > $iTime Opt('SendKeyDownDelay', $iTmp) EndFunc Link to comment Share on other sites More sharing options...
Cyber Posted May 4, 2009 Share Posted May 4, 2009 Very good, thanks Authenticity Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key 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