Sign in to follow this  
Followers 0
Newb

[Solved] Send Ctrl+M leaves ctrl pressed in some way

3 posts in this topic

#1 ·  Posted (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 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.

Share this post


Link to post
Share on other sites



;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.

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