Jump to content

quick question about holding down keys to send


Guest poog
 Share

Recommended Posts

Hi, I want to tell AutoIt to hold down the Left key for 200 milliseconds then stop, how can I do that? The help file doesn't seem to include this in the Send commands section?

Link to comment
Share on other sites

It includes it quite well but i have nothing to do so i will write a script for you even though you should be RTFM

Send ( "{leftdown}" )
Sleep ( 200 )
Send ( "{leftup}" )

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

It includes it quite well but i have nothing to do so i will write a script for you even though you should be RTFM

Send ( "{leftdown}" )
Sleep ( 200 )
Send ( "{leftup}" )

<{POST_SNAPBACK}>

This is not working for me... any ideas why?
Link to comment
Share on other sites

i forgot the spaces

Send ( "{left down}" )
Sleep ( 200 )
Send ( "{left up}" )
Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Hi, I want to tell AutoIt to hold down the Left key for 200 milliseconds then stop, how can I do that? The help file doesn't seem to include this in the Send commands section?

<{POST_SNAPBACK}>

As Xenogis states in post #4. Or, another way (also noted in the help file for the Send function) is:

opt("SendKeyDownDelay", 200)
Send("{left}")
opt("SendKeyDownDelay", 1)

Or, do you want the left key to be pressed repeatedly for 200 milliseconds?

$start = Timerinit()
Opt("SendKeyDelay", 1)
While TimerDiff($start) < 200
   send("{Left}")
wend

Phillip

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