Sign in to follow this  
Followers 0
themicroant

Quick Question

4 posts in this topic

how do i script for a key to be held down i know

send( "{SHIFTDOWN}")

works for shift key but i need something for the letter D to be held for x secs

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This has been discussed before, and simply holding down a key for a certain amount of time (unless it is a modifier key) doesn't work.

A workaround would be to send the key repeatedly for a certain amount of time.

$Timer = TimerInit()
Do
     Send ("d")
     Sleep (10); really won't do much on the sending, just to save CPU
Until TimerDiff ($Timer) > 10000; 10 seconds
Edited by greenmachine

Share this post


Link to post
Share on other sites

thx that helps, what exactly does the TimerInit() do?

Share this post


Link to post
Share on other sites

Look in the helpfile.

From the helpfile: TimerInit() "Returns a timestamp (in milliseconds)."

TimerDiff() "Returns a time difference (in milliseconds) from a previous call to TimerInit()."

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  
Followers 0