Jump to content
Sign in to follow this  
XLimas

Simple question about Send function

Recommended Posts

XLimas

Hello everyone,

I was trying to search for this topic, but couldn't find anything what i need.

My problem is that when i use "Send" function with "down" parameter the LCTRL stays pressed after i use "up" parameter, for example:

Sleep(100)
Send("{LCTRL down}")        ;Holds the LCTRL key down
MouseClick("left", 940, 646, 1, 1)  
Sleep(1000)
Send("{LCTRL up}")

After this code LCTRL is still pressed until i press LCTRL by myself. How can I fix it that it would be hold up?

Thanks,

Andrew

Share this post


Link to post
Share on other sites
bo8ster

sorry i should read the post properly. Have a look at SendKeyDownDelay

Edited by bo8ster

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Share this post


Link to post
Share on other sites
XLimas

I have tried using SendKeyDownDelay but still LCTRL holds down after this script has finished.

Here is different places where i tried to use it, still it don't help. As i know, same happens with SHIFT button.

Any ideas?

Sleep(3000)
;Opt("SendKeyDownDelay", 1000)
Send("{LCTRL down}")                        ;Holds the A key down
;Opt("SendKeyDownDelay", 1000)
Sleep(100)
MouseClick("left", 940, 646, 1, 1)
;Opt("SendKeyDownDelay", 1000)
Sleep(1000)
Send("{LCTRL up}")

Share this post


Link to post
Share on other sites
XLimas

Ok, i found it myself.

If someone has same problem, here is the solution:

You should use Send("{CTRLDOWN}") and Send("{CTRLUP}") instead of Send("{LCTRL down}") and Send("{LCTRL up}")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.