AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

keywait inside a loop

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
edu



Joined: 12 Oct 2006
Posts: 99
Location: Canada

PostPosted: Thu Dec 04, 2008 5:27 pm    Post subject: keywait inside a loop Reply with quote

Hi, I wonder why this script seems to ignore completely the command keywait:
Code:

f5::
Send, ^c
ClipWait, 1
values := Clipboard
Loop,Parse, values, `n,`r
{
   KeyWait, x
;   Send, {Right}
   Send, %A_Loopfield%
   
}
return

Am I missing the obvious? Confused
_________________
The best things of life are free.
Back to top
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 3254
Location: Simi Valley, CA

PostPosted: Thu Dec 04, 2008 5:35 pm    Post subject: Reply with quote

KeyWait waits for a key to be in its 'up' position. If you want to wait until that key is 'down', add the "D" option to the keywait command like
Code:
Keywait, x, D

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!
Back to top
View user's profile Send private message
edu



Joined: 12 Oct 2006
Posts: 99
Location: Canada

PostPosted: Thu Dec 04, 2008 6:38 pm    Post subject: Reply with quote

Thanks, [VxE]!
I realized that keywait was not the right approach, even with your example, as it would send the key x and all the rest immediately:

This is working great for me --- Autohotkey is just awesome:
Code:
f5::
Send, ^c
ClipWait, 1
Loop,Parse, Clipboard, `n,`r
{
   Input, trigger, V, {RControl}

   Send, %A_Loopfield%
   
}
return

then I can use the arrow keys to insert the values wherever I want in a spreadsheet.
_________________
The best things of life are free.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group