Peterrr
Peterrr

Reputation: 83

SendInput won't work at high speed

I have made a shortcut saying "alt j" goes one left with the arrows, like this:

!j::SendInput,{LEFT}

This works fine, except if I hold down "alt j" for too long. It will work fine most of the time but occasionally dropping small "j"s around the path im going. Say i Wanna go one letter at a time, through this sentence:

"Hello world"

it'll most likely become something like this:

"jHeljjlo jworljd"

Is there a way to put a tiny delay on every keystroke to make it able to keep up? or is this problem related to a default delay which has to be set down maybe?

Thanks for your help!

Upvotes: 0

Views: 1459

Answers (1)

phil294
phil294

Reputation: 10822

So this is still an issue for you? Looks to me like an AutoHotkey bug most likely, or wrongly sent js because your RAM can't handle the heavy programs well enough.

Things I can think of that you could try:

  • buy a better computer.

  • use setBatchLines, 1ms, making your script sleep 20ms each milli second and therefore consuming less cpu. This might clear AutoHotkey's mind.

  • SetKeyDelay, 50 might also help.

Sometimes, a pressed down modifier such as ctrl or alt, slows down windows drastically. This was at least the case under Windows Vista. So you might wanna get rid of the ! (alt) and stick to the j instead: the following script gets activated by !j and behaves just like your initial script, but will also keep running once you release ALT, as long as J is pressed down:

!j::
sendInput {left}
hotkey, *j, sendLeft, ON
hotkey, *j up, stopSendLeft, ON
return

sendLeft:
send {left}
return

stopSendLeft:
hotkey, *j, sendLeft, OFF
hotkey, *j up, stopSendLeft, OFF
return

Still, I don't have high hopes any of this will help you.

Upvotes: 1

Related Questions