Jump to content

Recommended Posts

Posted (edited)

hi im new to autoit and need help

send ("{x down}")

sleep (2000)

send ("{x up}")

when i execute that script the x are not been hold down why?

in notepad it should be like this xxxxxxxxxxxx cause i hold the key down for 2000 using sleep command instead i only get one x only..im not trying to send x 10x..what i want is to make the key hold down work..

sorry for my bad english

Edited by sisiws
Posted

This should do what you need, it will just press x continually for 2 seconds.

$TimeStamp = TimerInit() ;Create timestamp
While TimerDiff($TimeStamp) < 2000 ;While the timestamp is less than 2 seconds old, do this
    Send("x")
WEnd

Send("{x down/up}") is for use with key combinations, so stuff like Send("{x down}y{x up}") would be like holding x and pressing y, then releasing both.

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