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 

How do I make a script wait for a keypress to continue?

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



Joined: 19 Aug 2009
Posts: 4

PostPosted: Mon Nov 16, 2009 8:56 pm    Post subject: How do I make a script wait for a keypress to continue? Reply with quote

In the code below (sends a few different items to a Bloomberg screen), I'd like to replace the Sleep commands with something that will wait for the spacebar to be pressed before continuing. I know a Msgbox with just an "okay" works, but then that dialog box blocks the screen I'm looking at. I also tried using a separate hotkey for pausing, but that seemed inelegant.

Code:
^!z::
SetKeyDelay, 10
Send SPX {F10} IGPO5 {Enter}
Sleep,2500
Send IWM {F8} IGPO5 {Enter}
Sleep,2500
Send RJA {F8} IGPO5 {Enter}
Sleep,2500
Send MSFT {F8} IGPO5 {Enter}
Sleep,2500
Send USO {F8} IGPO5 {Enter}

Return
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 1770
Location: MN, USA

PostPosted: Mon Nov 16, 2009 9:00 pm    Post subject: Reply with quote

KeyWait
_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
Leef_me



Joined: 08 Apr 2009
Posts: 1158
Location: San Diego, California

PostPosted: Mon Nov 16, 2009 9:04 pm    Post subject: Reply with quote

Look at the first example for this command
http://www.autohotkey.com/docs/commands/Input.htm

Instead of all the other keys listed, you could {Space}
Back to top
View user's profile Send private message
jg0001



Joined: 19 Aug 2009
Posts: 4

PostPosted: Mon Nov 16, 2009 9:23 pm    Post subject: Reply with quote

Excellent... I don't know how I missed that.
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 1158
Location: San Diego, California

PostPosted: Mon Nov 16, 2009 9:31 pm    Post subject: Reply with quote

FYI sometimes I just look at the catalog

http://www.autohotkey.com/docs/commands
In the helpfile it is under the Contents tab about 12th on the list.
Alphabetical List of Command.

I think of the old TV series "Mission: Impossible"
The leader looks at the list of experts available and chooses the ones that have the skills needed.

Also, under the "input" comamnd is a list called "related"
KeyWait, Hotstrings, InputBox, #InstallKeybdHook, Threads, if var in/contains MatchList
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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