Sign in to follow this  
Followers 0
texan

Pause script when key is pressed

4 posts in this topic

I am looking for a way to create a hotkey to pause a script while it is processing. Is this possible?

I created a script that will be adding some data records in a system. A User will monitor this process and if anything goes wrong I want them to be able to suddenly pause the execution of the script. Ideally, I was going to tell them to press the Pause key on the keyboard and I want the script to pause when this occurs.

I have a GUIWindow for my script, I am using GuiOnEventMode 1 and I know how to pause the scrip using a button on the GUI. I was just hoping to do this with the simple press of the Pause button. My concern is that the script might be using mouse commands and the user would have to fight the script to be able to press the button.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Although not using a button, this function HotKeySet will help. See the Example code there. Also read here, GUIRegisterMsg, and here, GUIRegisterMsg - AutoIt Wiki.<br>

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Perfect! That's what I was looking for. Thanks!

Share this post


Link to post
Share on other sites

You bet. Good luck!


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0