Jump to content

send key hold help


Recommended Posts

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

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.

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