Jump to content

Recommended Posts

Posted

I've seen lots of threads where I can hold a key down for a certain period of time, but all of them involve "sleep". What if I want to do other things while the key is being held down? Does AutoIt support this?

Something like: Send("{Up 1000}")

That will press the up arrow 1000 times, is there anyway to hold the key down for 1000ms? (Without using sleep)

Posted (edited)

From the help file:

"To hold a key down

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

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

Edited by megablox

"The story of a blade is linked in Blood." 

―Yasuo

 

Posted

What the problem with using sleep(1000)?

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Posted

  On 9/2/2012 at 9:16 PM, 'Bowmore said:

What the problem with using sleep(1000)?

He wants to execute code when the key is held down, he did not know how to do it instead of setting a Sleep which prevents from executing something else.

Br, FireFox.

Posted

  On 9/3/2012 at 1:43 AM, 'Ritzky said:

That doesn't hold a key down for a set amount of time, it holds it down forever until I call the KeyUp function.

Then you call KeyUp after a set amount of time. Look up for example AdlibRegister().

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...