base number of keypresses on variable setting Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
CrowexBR
Posts: 12
Joined: 15 Apr 2024, 06:57

base number of keypresses on variable setting

Post by CrowexBR » 01 May 2024, 06:47

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.]
User avatar
mikeyww
Posts: 27146
Joined: 09 Sep 2014, 18:38

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

Post by mikeyww » 01 May 2024, 07:23

Code: Select all

#Requires AutoHotkey v2.0
n := 5

6::Send '{Down ' n '}'
User avatar
CrowexBR
Posts: 12
Joined: 15 Apr 2024, 06:57

Re: base number of keypresses on variable setting

Post by CrowexBR » 01 May 2024, 10:04

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:
Post Reply

Return to “Ask for Help (v2)”