Sign in to follow this  
Followers 0
kra55

OnEvent Mode Gui - Ignore keypress during event/macro running / pause on esc press

8 posts in this topic

Hey everyone,

A problem i have had for a while is that people get impatient during certain sleeps in my scripts. They will get impatient and click one of the buttons which will que that event to start as soon as the current event has finished. I would like to know if it is possible to make my macro ignore all keypress's while an event is occuring. Except maybe esc. It would be good if Esc was pressed it would ask if you wish to end the script or allow it to continue. I apologise if this has already been answered. If so i was using the wrong search terms :idea:

Thanking you in advance...Thank you.

Share this post


Link to post
Share on other sites

Are you using hotkeys & buttons to execute certain events?

What I do when a function is going to take a while is either disable or hide the buttons until the function is complete. (With a repeating progress bar or a please wait or something)

Typically I use a general disable() and enable() function which will disable all buttons & hotkeys when the function begins and ends.

Share this post


Link to post
Share on other sites

hahahhahaha silly me Thank you for the info - will just create a disable all fuction that starts at the begining of every event :idea:

Share this post


Link to post
Share on other sites

Now to be a pain is there anyway i can make esc interupt the script and ask if i wish to continue or quit?

Share this post


Link to post
Share on other sites

Now to be a pain is there anyway i can make esc interupt the script and ask if i wish to continue or quit?

Yes you can as long as you are not in another Event triggered Func, but that is just a matter of design.

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

This might be a stupid way of getting around it but couldnt i just have another script running that waits for a hotkey to be pressed and closes the script from the icon tray?

Unfortunately random things happen and scripts get stuck. People cant seem to understand that they simply have to right click on the icon and hit Exit to end the script !!!!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Now to be a pain is there anyway i can make esc interupt the script and ask if i wish to continue or quit?

If you use hotkeyset() with esc then it can interrupt even if you are in an event. You can just use a box to ask quit/continue.

couldnt i just have another script running

You can assign the hotkey in the main script, it should work. (It's always worked for me)

Edited by hawky358

Share this post


Link to post
Share on other sites

YAY - Thank you gotta love the basic things i overlook !!!!

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