Sign in to follow this  
Followers 0
mach42

Can you hold a key down "x" seconds?

10 posts in this topic

WOW!

It has been a few months since I last built a script and it's a new ball game. I've looked but can't see an obvious way to hold the space bar key down for "x" seconds. This would be handy in a flash game where you "build" power and let it go.

Any suggestions where to look for a similar function?

Thanks

Share this post


Link to post
Share on other sites

Send("{SPACE Down}")
Sleep(3000) ; 3 seconds
Send("{SPACE Up}")
I want to hold down Ctrl rather than Space, but it won't work. Would it be...

Send("{Control Down}")

Sleep(3000) ; 3 seconds

Send("{Control Up}")

I've tried Ctrl aswell, won't work.

Share this post


Link to post
Share on other sites

Try "{RCTRL Down}" or "{LCTRL Down}"

Share this post


Link to post
Share on other sites

Thanks!

I'm back to searching where that came from in documentation.

Share this post


Link to post
Share on other sites

And how to hold arrow keys {UP} {DOWN} {LEFT} and {RIGHT} ?

Share this post


Link to post
Share on other sites

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

i'm asking how to hold up, down...

Send("{up down}")
   Send("{up up}")
   Send("{down down}")
   Send("{down up}")

is not work :)

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