Page 1 of 1

base number of keypresses on variable setting

Posted: 01 May 2024, 06:47
by CrowexBR
Good morning, everyone.

How do I script so that when I set a variable with the value of 5, if I press a {Key 6}, it automatically sends {Down} * 5 times? (I am sorry, i don't know how to use "kbd" on forum.)
How can I do this?

Thanks :dance:


[Mod edit: Added a subject line since none was provided.]

Re: base number of keypresses on variable setting  Topic is solved

Posted: 01 May 2024, 07:23
by mikeyww

Code: Select all

#Requires AutoHotkey v2.0
n := 5

6::Send '{Down ' n '}'

Re: base number of keypresses on variable setting

Posted: 01 May 2024, 10:04
by CrowexBR
mikeyww wrote:
01 May 2024, 07:23

Code: Select all

#Requires AutoHotkey v2.0
n := 5

6::Send '{Down ' n '}'
Thank you so much, mikeyww!
You're the real MVP for sorting out all these queries! Respect++!

Crowex :bravo: