Jump to content

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


Newb
 Share

Recommended Posts

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.

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...