Andrew Chen Posted June 23, 2011 Posted June 23, 2011 I am trying to watch if the user presses [ESC] key, to terminate the program. Thanks
Donald8282 Posted June 23, 2011 Posted June 23, 2011 I am trying to watch if the user presses [ESC] key, to terminate the program. Thanks You can do this:While 1 HotKeySet("{ESC}", "_Exit") WEnd Func _Exit() Exit EndFunc
Andrew Chen Posted June 23, 2011 Author Posted June 23, 2011 Thanks! If I put this while loop in the top of my code, will the rest still run, or will it be stuck in this while loop?
Donald8282 Posted June 23, 2011 Posted June 23, 2011 Post your source and I'll show you where to put it.
somdcomputerguy Posted June 23, 2011 Posted June 23, 2011 (edited) That code is wrong, hotkeyset shouldn't be in a while loop, it should be like this: HotKeySet("{ESC}", "_Exit") While 1 Sleep(10) WEnd Func _Exit() Exit EndFunc Edited June 23, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Andrew Chen Posted June 23, 2011 Author Posted June 23, 2011 ahh okay, that makes everything much easier. Thanks
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now