Sign in to follow this  
Followers 0
vickerps

Hotkey

8 posts in this topic

Does anyone no how to setup a key that will exit the script

I was trying with AdlibEnable("quit")

Func Quit()

IF HotKeySet ({esc}) Then

Exit

Endif

Something like that. Can anyone help

Share this post


Link to post
Share on other sites



first of all thanks for responding

However i have already try that and it doesn't work for example

HotKeySet("{ESC}", "Terminate")

MsgBox(64, "Welcome", ' ' & @LF & @LF &'Please follow a few simple steps ')

Func Terminate()

Exit

EndFunc

I would like the script to terminate without clicking on the message box

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Just a thought....

May want to experiment a bit...

Does the hot key checking routine operate while waiting for user input?

(In other words, the fact that the program is waiting for you to click "ok" before proceeding may mean that hotkey checking is suspended, as is the rest of the program, until you do so)

Edited by everseeker

Everseeker

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I would like the script to terminate without clicking on the message box

Change the MsgBox to a SplashTextOn.

When you display a msgbox you are asking for user input or you can have the msgbox timeout after x seconds.

Edited by JdeB

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

Share this post


Link to post
Share on other sites

Thanks again

But need to use a message box and it can not time out

I understand what you are saying and i agree. that is why i was looking into the adlibenable command.

Thanks anyway

Share this post


Link to post
Share on other sites

Thanks again

But need to use a message box and it can not time out

I understand what you are saying and i agree. that is why i was looking into the adlibenable command.

Thanks anyway

what about something like this?

HotKeySet("{ESC}", "Terminate")
HotKeySet("{ENTER}", "Continue")
$Loop = 1

SplashTextOn ("Welcome", ' ' & @LF & @LF &'Please follow a few simple steps ')
While $Loop=1
   Sleep(200)
Wend
SlashTextOf()
; rest of the script

Func Terminate()
   Exit
EndFunc

Func Continue()
   $loop = 0
EndFunc

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

Share this post


Link to post
Share on other sites

Explanation of behavior from the help file:

If the current function is a "blocking" function, then the keypresses are buffered and execute as soon as the blocking function completes. MsgBox and FileSelectFolder are examples of blocking functions.

Maybe the AutoGUI project could provide even more alternatives....

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

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