Jump to content

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


Recommended Posts

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.

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.

Link to post
Share on other sites
  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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 !!!!!!!!!!!!!!!!

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?

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...