Sign in to follow this  
Followers 0
bmaker

Send: Keys cant be released?

8 posts in this topic

#1 ·  Posted (edited)

I got an annoying bug or whatever. Try this code:

Send("{LCTRL down}")
Sleep(1000)
Send("{LCTRL up}")

Even after the script execution stops the CTRL button is still pressed, even if you didnt touch it. I guess, key releasing just doesnt work.

I appreciate any comments / suggestions!

Regards,

- bmaker

Edited by bmaker

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Read this post/thread and the bug report link in that post:

http://www.autoitscript.com/forum/index.ph...st&p=560741

It must be a feature instead of a bug :-(

Thank you for your reply! In my opinion it's a bug as long as it is not documented in the Send() documentation. AutoIt is great and the documentation is very good all in all, but it seems that this issue isnt mentioned anywhere in the documentation. Actually the documentation is WRONG, because it says that my code should press CTRL and release it afterwards. That doesnt happen.

Where can I find the "FAQ workaround"? I dont find it, sorry.

Regards, bmaker

Edited by bmaker

Share this post


Link to post
Share on other sites

Thank you for your reply! In my opinion it's a bug as long as it is not documented in the Send() documentation. AutoIt is great and the documentation is very good all in all, but it seems that this issue isnt mentioned anywhere in the documentation. Actually the documentation is WRONG, because it says that my code should press CTRL and release it afterwards. That doesnt happen.

Where can I find the "FAQ workaround"? I dont find it, sorry.

Regards, bmaker

It's a sticky in this forum.

Here's the post by martin: #512706


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

...Actually the documentation is WRONG, because it says that my code should press CTRL and release it afterwards. That doesnt happen...

I've use AutoIt since the V2 days and I have lots of scripts that use the Windows modifier keys. They all worked fine until something changed. Either one of the 1000s of XP patches changed the OS or something changed within AutoIt3. I'm willing to say that AutoIt maybe sending the correct commands to the OS - but the OS no longer does what it is supposed to do.

My Bug Report died and I'm not sure how to resurrect it. Perhaps others will have to submit a Bug Report on the issue.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thank you for your replies, I guess I fixed my issue now.

Anyway, this still doesnt work for example:

_SendEx("{LCTRL down}") ; holds down LCTRL

_SendEx("{LCTRL up}") ; cant release LCTRL, because SendEx waits for LCTRL to be released

All in all: AutoIt cant be used to hold down special keys like CTRL, ALT and SHIFT, because they cant be released by AutoIt afterwards.

Share this post


Link to post
Share on other sites

...All in all: AutoIt cant be used to hold down special keys like CTRL, ALT and SHIFT, because they cant be released by AutoIt afterwards.

Bummer - I was so wrapped up in the dead bug report that I failed to test your code with martin's work around before pointing you there.

Glad that you found another way.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

The problem with LCTRL down and LCTRL up doesn't occur with CTRLDOWN and CTRLUP, although that might not help.

But here's a way to turn off LCTRL down

Send("{LCTRL down}")
sleep(1000)
Send("{CTRLDOWN}")
Send("{CTRLUP}")

The reason this works is, um, well it's because ........

I have no idea.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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