themicroant Posted March 27, 2006 Posted March 27, 2006 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
greenmachine Posted March 27, 2006 Posted March 27, 2006 (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 March 27, 2006 by greenmachine
themicroant Posted March 27, 2006 Author Posted March 27, 2006 thx that helps, what exactly does the TimerInit() do?
greenmachine Posted March 27, 2006 Posted March 27, 2006 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()."
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now