megahyperion Posted April 22, 2005 Share Posted April 22, 2005 I dont think you can actually sleep a program while holding down a key since you are acutally pausing the script and everything it does so I was wondering is there anyway to do it? Like to use the Send("{a down}") command to hold down the a key, now lets say I wanna hold down the a key for like 3 seconds, how can I do this ? Thanks Link to comment Share on other sites More sharing options...
megahyperion Posted April 22, 2005 Author Share Posted April 22, 2005 woops one more thing, I cant use the setup that allows the keypresses to be longer because I actually need the whole script to pause and wait for the key to finish being held down. Thanks Link to comment Share on other sites More sharing options...
steveR Posted April 22, 2005 Share Posted April 22, 2005 Send("{a down}") sleep(3000) Send("{a up}") will that work? AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
megahyperion Posted April 22, 2005 Author Share Posted April 22, 2005 (edited) Nah it will send the key then sleep for 3 seconds while not doing anything. Heres what I used to test it Run("Notepad.exe") Sleep(2000) Send("{a down}") sleep(3000) Send("{a up}") Edited April 22, 2005 by megahyperion Link to comment Share on other sites More sharing options...
steveR Posted April 22, 2005 Share Posted April 22, 2005 (edited) Sorry, i was tired Run("Notepad.exe") Sleep(2000) $t = TimerInit() Do Send("a") sleep(50) Until TimerDiff($t) > 3000 Edited April 22, 2005 by steveR AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
megahyperion Posted April 23, 2005 Author Share Posted April 23, 2005 Woot , your the man. Works like a charm Thanks Link to comment Share on other sites More sharing options...
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