Sign in to follow this  
Followers 0
GGCrew

Hold keystroke, enter other keystrokes, release original keystroke?

7 posts in this topic

Is there a command to do this? I already know about commands like ALTDOWN etc. for various function buttons...

but for example... what if I want to hold the Y key, and while still holding it, input K, S, T, wait 1 second, Q, release Y?

I didn't see any command when I searched through the options, but it's possible that I missed it...

I also tried {yDOWN} which of course doesn't work.

Share this post


Link to post
Share on other sites



Hi and Welcome to the forums!

Straight out from the helpfile:

To hold a key down (generally only useful for games)

Send("{a down}") ;Holds the A key down

Send("{a up}") ;Releases the A key

Please try it yourself next time, you could learn something ;)

Share this post


Link to post
Share on other sites

Did you ever tried it by yourself with AutoIt V3?

With this you should get sequences of a's if the cursor is in an editor.

What you get is a single 'a' every 6 seconds.

Any suggestions, why this is not working as described in the helpfile?

While True
 Send("{a down}")
 Sleep(5000)
 Send("{a up}")
 Sleep(1000)
WEnd

Share this post


Link to post
Share on other sites

Did you ever tried it by yourself with AutoIt V3?

With this you should get sequences of a's if the cursor is in an editor.

What you get is a single 'a' every 6 seconds.

Any suggestions, why this is not working as described in the helpfile?

You send one "A", you get one "A". That is how it works, and the helpfile doesn't mention otherwise.

Share this post


Link to post
Share on other sites

With this you should get sequences of a's if the cursor is in an editor.

$begin = TimerInit()
Do
    Send('a')
Until TimerDiff($begin) > 1000

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
Share on other sites

Thx for the hints.

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