Andrew Chen Posted June 23, 2011 Share Posted June 23, 2011 I am trying to watch if the user presses [ESC] key, to terminate the program. Thanks Link to comment Share on other sites More sharing options...
Donald8282 Posted June 23, 2011 Share 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 Link to comment Share on other sites More sharing options...
Andrew Chen Posted June 23, 2011 Author Share 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? Link to comment Share on other sites More sharing options...
Donald8282 Posted June 23, 2011 Share Posted June 23, 2011 Post your source and I'll show you where to put it. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 23, 2011 Share 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. Link to comment Share on other sites More sharing options...
Andrew Chen Posted June 23, 2011 Author Share Posted June 23, 2011 ahh okay, that makes everything much easier. Thanks Link to comment Share on other sites More sharing options...
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