Newb Posted February 11, 2011 Share Posted February 11, 2011 (edited) Hi all.I need to send a Ctrl+M hotkey press to an application.I am using this code:Send("{LCTRL down}") Send("{m down}") Sleep(500) Send("{m up}") Send("{LCTRL up}")Because I can't just do Send("^m")(Here is explained why, if you care)The fact is that, for some reason I don't get, it seems that the ctrl key, after that the script reached the particular code i typed above, leaves ctrl pressed for the rest of the script, totally avoiding the normal execution of the script, because any keystroke is sent, it's treated like if it's combined with CTRL.If the script sends "hi" the program will receive CTRL+h CTRL+i. The only way to stop it from pressing ctrl is by pressing ctrl+alt+canc or breaking the script execution..The script is fucked up with that bug, because it can't type anymore...Any suggestion? Edited February 11, 2011 by Newb I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. Link to comment Share on other sites More sharing options...
JohnOne Posted February 11, 2011 Share Posted February 11, 2011 (edited) ;Send("{LCTRL down}") Send("{CTRLDOWN}") Send("m") Send("{CTRLUP}") ;Sleep(500) ;Send("{m up}") ;Send("{LCTRL up}") Edited February 11, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Newb Posted February 11, 2011 Author Share Posted February 11, 2011 ;Send("{LCTRL down}") Send("{CTRLDOWN}") Send("m") Send("{CTRLUP}") ;Sleep(500) ;Send("{m up}") ;Send("{LCTRL up}") Worked fine, but i had to leave the sleep after the Send "m", or it wouldn't work. Thanks for the help I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. 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