Jump to content

Delayed key down not resulting in repeats?


Xibalba
 Share

Recommended Posts

For (5)
  Send("{a down}")
  Sleep(200, 2000, 1)
  Send("{a up}")
  Send({ENTER})
Next

In notepad, the result is always:

a
a
a
a
a

When I expect something like this (depending on key delay in OS):

aaa
a
aa
aa
aaa

Have I missed something or why isn't some of the a's repeated?

Link to comment
Share on other sites

Sleep has no 'random' abilities built into it. Check the Random() function in the docs.

Yeah ok, I cheated. I didn't post my working code, since I'm fairly sure it isn't any syntax problem.

For the sake of it, I'm using a correct For-loop as well as this:

$delay = Random(200, 2000, 1)
Sleep($delay)

Question in OP remains.

Link to comment
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
 Share

  • Recently Browsing   0 members

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