Jump to content
Sign in to follow this  
Guest poog

quick question about holding down keys to send

Recommended Posts

Guest poog

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?

Share this post


Link to post
Share on other sites
zcoacoaz

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]

Share this post


Link to post
Share on other sites
Guest poog

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?

Share this post


Link to post
Share on other sites
zcoacoaz

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]

Share this post


Link to post
Share on other sites
phillip123adams

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

Share this post


Link to post
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
Sign in to follow this  

×