elitesoldier Posted January 11, 2004 Share Posted January 11, 2004 hi i want to use the send command to hold down a key and let go after a certain amount of time that i set. I was thinking of doing it this way but don't know how to make autoit v3 hold down a key. Send ("{END}") (---but holds it down and doesn't let go. Sleep ("5000") (----delay, while still holding down END key. Send ("{END}") (----lets go of END key. thx for your time and help Link to comment Share on other sites More sharing options...
elitesoldier Posted January 12, 2004 Author Share Posted January 12, 2004 nvm guys i just remapped my keyboard to work with the commands that allow to hold a key down. Link to comment Share on other sites More sharing options...
Administrators Jon Posted January 12, 2004 Administrators Share Posted January 12, 2004 I;ve justed added something to the unstable version that may work in games:http://www.hiddensoft.com/autoit3/files/unstable/Send ("{END down}") Sleep (5000) Send ("{END up}") Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
cmallett Posted January 12, 2004 Share Posted January 12, 2004 That's exactly the syntax that Robert Yaklin and I came up with for AutoHotkey, though it hasn't yet been added. When you think about it, I guess it's the about the only logical way to do it. Link to comment Share on other sites More sharing options...
Administrators Jon Posted January 12, 2004 Administrators Share Posted January 12, 2004 Yeah, I had already run out of sensible modifiers Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Developers Jos Posted January 12, 2004 Developers Share Posted January 12, 2004 I;ve justed added something to the unstable version that may work in games: http://www.hiddensoft.com/autoit3/files/unstable/ Send ("{END down}") Sleep (5000) Send ("{END up}")Jon, Did you do the same for {LEFT ...}{RIGHT ....}{UP ...}{DOWN ...} ??? (Gave it a try but didn't work...) see: http://www.hiddensoft.com/forum/index.php?...t=15entry1966 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Administrators Jon Posted January 12, 2004 Administrators Share Posted January 12, 2004 Jon, Did you do the same for {LEFT ...}{RIGHT ....}{UP ...}{DOWN ...} ??? (Gave it a try but didn't work...) see: http://www.hiddensoft.com/forum/index.php?...t=15entry1966 It's doesn't "do" anything in windows (and it would be no use anyway), but in games it does - I tried it in "Call of Duty" and made it hold down the left key for 5 seconds (right into a bullet ) It works for all keys, Larry, for A it would be: Send("{a down}") Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
redndahead Posted January 12, 2004 Share Posted January 12, 2004 Just for some smaller syntax possible to change to this send("what to send",[optional duration]) It would send each key seperately holding it down and then releasing after optional time. I don't know.... just thinking. red Link to comment Share on other sites More sharing options...
redndahead Posted January 12, 2004 Share Posted January 12, 2004 (edited) Maybe this would be an example of a user function. run("notepad.exe") sleep(2000) HoldSend("abcde",2000) exit Func HoldSend($a,$b) $count = stringlen($a) for $i = 1 to $count $letter = stringmid($a,$i,1) Send("{" & $letter & " down}") sleep($b) Send("{" & $letter & " up}") next EndFunc This was pretty much off the top of my head so there could be errors but I am sure you get the idea. red There was problems when I tested this it doesn't repeatedly send characters so maybe it works or maybe not. I can see how it would be not very usefull. Edited January 12, 2004 by redndahead Link to comment Share on other sites More sharing options...
Lemures Posted January 13, 2004 Share Posted January 13, 2004 i like red's idea, for a duration, that would be pretty nice. or perhaps until something is true? like Send("{w LiftUp=1}"), though i suppose the keyup could just be done with a hotkey or something. i probably will never use anything but the down and up, and possibly the durations 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