mikjay Posted January 22, 2010 Share Posted January 22, 2010 Howdy folks, I'm trying to get a portion of my script working, that waits for the user to press enter to continue. It sounds easy enough, but there are 2 places where it shows intermittent behavior. $dll = DllOpen("C:\Windows\System32\user32.dll") ;Added these lines because it seemed like the key could be sticking DllCall($dll,"int","keybd_event","int",0x0D,"int",0,"long",2,"long",0) Sleep(50) While 1 If _IsPressed("0D") = 1 then ExitLoop Sleep(50) WEnd The first, and most annoying property of this code is that, every once in awile, the script will continue without enter being pressed. The second, not critical but annoying as well, is that sometimes the enter key will have to be pressed multiple times. Is there a better way to go about this? It seems simple enough. Thanks! Link to comment Share on other sites More sharing options...
jvanegmond Posted January 22, 2010 Share Posted January 22, 2010 (edited) MsgBox(0, "","Press enter and continue ;]") Also, consider HotKeySet register and unregister. Edited January 22, 2010 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
mikjay Posted January 22, 2010 Author Share Posted January 22, 2010 MsgBox(0, "","Press enter and continue ;]") Also, consider HotKeySet register and unregister. Manadar, thank you for your comments! I was thinking since I was waiting for user to click an object before pressing enter that a Msgbox could not be open, but it looks like it should work anyway. 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