yookee Posted December 9, 2008 Share Posted December 9, 2008 For ExampleSend("{TAB " & $n & "}")andFor $i = 1 To $nSend("{TAB}")NextThey may be same one. As if set SendKeyDelay before them, there is little difference.In later codes, of course, a SendKeyDelay between twice Send()s. Then how is the former? In Send(n) on my computer, it seem delay "Default" delay.Opt("SendKeyDelay", 40) befit me, 30ms go wrong.Default SendKeyDelay is 5ms in help. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 9, 2008 Share Posted December 9, 2008 For Example Send("{TAB " & $n & "}") and For $i = 1 To $n Send("{TAB}") Next They may be same one. As if set SendKeyDelay before them, there is little difference. In later codes, of course, a SendKeyDelay between twice Send()s. Then how is the former? In Send(n) on my computer, it seem delay "Default" delay. Opt("SendKeyDelay", 40) befit me, 30ms go wrong. Default SendKeyDelay is 5ms in help. I don't see what the question is. The delay is very consistent. The total time for one key send is SendKeyDelay plus SendKeyDownDelay, which by default is 5ms + 5ms = 10ms. Changing the SendKeyDelay gives very consistent results when tested: expandcollapse popup$n = 20 Opt("SendKeyDelay", 40) $iTimer = TimerInit() Send("{TAB " & $n & "}") ConsoleWrite("Send() with delay = 40: " & Round(TimerDiff($iTimer)) & "ms" & @LF) $iTimer = TimerInit() For $i = 1 To $n Send("{TAB}") Next ConsoleWrite("Loop with delay = 40: " & Round(TimerDiff($iTimer)) & "ms" & @LF) Opt("SendKeyDelay", 5) $iTimer = TimerInit() Send("{TAB " & $n & "}") ConsoleWrite("Send() with delay = 5: " & Round(TimerDiff($iTimer)) & "ms" & @LF) $iTimer = TimerInit() For $i = 1 To $n Send("{TAB}") Next ConsoleWrite("Loop with delay = 5: " & Round(TimerDiff($iTimer)) & "ms" & @LF) Opt("SendKeyDelay", 0) $iTimer = TimerInit() Send("{TAB " & $n & "}") ConsoleWrite("Send() with delay = 0: " & Round(TimerDiff($iTimer)) & "ms" & @LF) $iTimer = TimerInit() For $i = 1 To $n Send("{TAB}") Next ConsoleWrite("Loop with delay = 0: " & Round(TimerDiff($iTimer)) & "ms" & @LF) Results: >Running:(3.2.12.1):C:\Program Files\AutoIt3\autoit3.exe "C:\temp\Test.au3" Send() with delay = 40: 935ms Loop with delay = 40: 936ms Send() with delay = 5: 208ms Loop with delay = 5: 207ms Send() with delay = 0: 102ms Loop with delay = 0: 106ms +>10:27:05 AutoIT3.exe ended.rc:0 Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
yookee Posted December 10, 2008 Author Share Posted December 10, 2008 Great, creditably MVP. I found that is my mistake catching different focus each time. So it always click wrong button. I set SendKeyDelay very large look where each TAB focus . 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