Jump to content

Mouseclick and KeyPress


Recommended Posts

Hello. I'm new the autoit and I have a question.

I understand the command.

MouseClick("right", 500, 452, 1, 20)

Presses right click on moust for 1 second on coordinate 500, 452. I still don't know what 20 is.

But how do I use keyboard?

I tried

KeyPress("s", 5)

What I'm trying to do is press S button for 5 seconds.

Anyone can give me a hand?

Link to comment
Share on other sites

Hey there Donaldo, the 20 represents the speed of the click. Meaning the number you've set is how much it is delayed. And for pressing a key or simulating keystrokes try this code:

Send("{S}")
Sleep(5000)
Send("{S up}")
Hope that helps, Clipper34.

Link to comment
Share on other sites

Hey thanks for the reply.

I tried your code.

Send("{S}")

Sleep(5000)

Send("{S up}")

What it did was pressed S for split second, then waited 5 seconds.

Then pressed S again.

What I want to do is press and hold S key for 5 seconds. Can you give me a hand again?

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...