Jump to content
Sign in to follow this  
Red-Steel

Holding a key down

Recommended Posts

Red-Steel

Hello,

How can I hold a key down for like 10 seconds in autoit?

I tried:

Send("{a down}")

Sleep ( 10000 )

Send("{a up}")

but it doesn't seem to work since it only sends 1 "a", wait 10 seconds and then close.

thanks!

Share this post


Link to post
Share on other sites
andygo

use the option

AutoItSetOption ( SendKeyDownDelay, 10000)

Alters the length of time a key is held down before being released during a keystroke. For applications that take a while to register keypresses (and many games) you may need to raise this value from the default. A value of 0 removes the delay completely.
Time in milliseconds to pause (default=5).

Share this post


Link to post
Share on other sites
Red-Steel

use the option

AutoItSetOption ( SendKeyDownDelay, 10000)

Alters the length of time a key is held down before being released during a keystroke. For applications that take a while to register keypresses (and many games) you may need to raise this value from the default. A value of 0 removes the delay completely.
Time in milliseconds to pause (default=5).

Thanks, it stills only send only one "a" but I'll try inside the game to see if it really does hold the key down.

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.