Jump to content

Recommended Posts

Posted

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 :whistle:

Posted

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.

  • Developers
Posted

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.
  :)

  • Administrators
Posted

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 :whistle: )

It works for all keys, Larry, for A it would be:

Send("{a down}")

Posted

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

Posted (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 by redndahead
Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...