Jump to content
Sign in to follow this  
pizzadude223

Hold a key

Recommended Posts

pizzadude223

you know how this Send("+{UP 10000}") presses the up key 10,000 times. How would i substitue a key being held for a certain amount of time instead of a key being pressed 10,000 times. My computer lagges with the 10,000 presses but if I were t have it held I don't think it would.

Share this post


Link to post
Share on other sites
Tvern

According to the helpfile for Send():

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

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

Only issue is that this doesn't seem to work for me anymore (probably since switching to win7), but maybe it works for you.

Share this post


Link to post
Share on other sites
SmokNiszczyciel

If l want script hold any key then for example l do

send("{a enter"}) ? "a" means hold?:blink:

Share this post


Link to post
Share on other sites
pizzadude223

Well I have xp so it might for me, but how would I put like a wait time inbetween the down and release?

Share this post


Link to post
Share on other sites
Thatsgreat2345

You can either use sleep to wait, or a timer as well, or a loop or hotkey to wait for a key to be pressed to then stop the key being pressed down.

Share this post


Link to post
Share on other sites
niubbone

If l want script hold any key then for example l do

send("{a enter"}) ? "a" means hold?:blink:

No, You do send("{a down"}).

To keep it pressed, put a sleep(x) between send("{a down"}) and send("{a up"})

Example

send("{a down"})

Sleep(2000)

send("{a up"})

Keeps a pressed for 2 seconds and exits.

Share this post


Link to post
Share on other sites
pizzadude223

No, You do send("{a down"}).

To keep it pressed, put a sleep(x) between send("{a down"}) and send("{a up"})

Example

send("{a down"})

Sleep(2000)

send("{a up"})

Keeps a pressed for 2 seconds and exits.

That just presses it once because of the sleep function ending it.

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.