To repeat a keystroke without using loop Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
wKey
Posts: 7
Joined: 08 Jul 2019, 05:08

To repeat a keystroke without using loop

Post by wKey » 01 Jun 2023, 12:08

I want to send something like this :

Code: Select all

Send "{Right 4}"
with key name and times stored in variables
so my code is :

Code: Select all

key := "Right"
times := 4
Send "{%key% %times%}"
It didn't do anything / show any error.

User avatar
boiler
Posts: 16772
Joined: 21 Dec 2014, 02:44

Re: To repeat a keystroke without using loop  Topic is solved

Post by boiler » 01 Jun 2023, 12:16

Assuming you’re really using v2 since that’s where you posted and your code is incorrect for both v1 and v2, v2 always uses expressions:

Code: Select all

Send "{" key " " times "}"

wKey
Posts: 7
Joined: 08 Jul 2019, 05:08

Re: To repeat a keystroke without using loop

Post by wKey » 01 Jun 2023, 12:44

I'm using v2 indeed
Thank you, it worked.

Post Reply

Return to “Ask for Help (v2)”