Reputation: 21
I want to simply make a script for send "2x arrow right" in autohotkeys. I now have:
^Tab::
Send,
return
After Send, I tried several combinations, some of them being {right}, {Right}, plus over 10 more combinations I found on the net which supposed to perform the difficult task of arrow right, but none which managed to work. Only thing I want is to Send, [insert some words which will do the trick] to have autohotkeys perform "2x arrow right". Would make my life a lot easier during programming. Who can help me out?
Upvotes: 1
Views: 8046
Reputation: 5548
No need for Return
for single-line statements. Keys can be repeated as so:
^Tab::SendInput {Right 2}
See more about repeating keys with Send[Raw|Input|Play|Event]
and about using SendInput
instead of Send
here: https://www.autohotkey.com/docs/commands/Send.htm#SendInputDetail
Upvotes: 2
Reputation: 2344
Switched from Send
to SendInput
for reliability.
The easiest way to solve this would just be to make your script send two SendInput, {right}
one after another.
For Example:
^Tab::
SendInput, {right}
SendInput, {right}
return
If you needed it to loop a finite number of times, you could use this instead:
^Tab::
Loop 2 ;replace '2' with however many times you want the next line to repeat
SendInput, {right}
return
Sidenote: In the context that I am using it, return just means to stop executing a multi-line hotkey. What your example above does is send the word "return". If you want to send a special key like the right arrow button or the return/enter key, you would have to enclose it in curly braces {}
. For example, {right}
or {return}
corresponding to the aforementioned examples. For more information about this, please see this documentation link.
Upvotes: 1