LEARNING AHK for learning purposes need help

Ask gaming related questions (AHK v1.1 and older)
croagy
Posts: 5
Joined: 03 May 2021, 19:27

LEARNING AHK for learning purposes need help

Post by croagy » 04 May 2021, 12:04

Hey there AHK Community I got a question and need a little help I'm new with AHK and have been reading all of the HOW TO Doc's posted by AHK them selves but having troubles finding a good learning how to on binding the "Number 1 key" to the "/? key" down by ur right shift on your keybored I wanna be able to press "?/ key" to toggle the "number 1 key" up and down when "?/" is pressed would anyone by any chance already have a simple code wrote that can do that or a better learning link that would be helpful thanks again AHK community for reading and helping :P

croagy
Posts: 5
Joined: 03 May 2021, 19:27

Re: LEARNING AHK for learning purposes need help

Post by croagy » 04 May 2021, 12:10

Update Ive got the code down and its working but if anyone could fix it to make it better and randomize that would be great heres what i got down for now

Code: Select all

repeating1 = 0

/::
if (repeating1 = 0)
{
    repeating1 = 1
    SetTimer, repeat1, 200
}
else
{
    repeating1 = 0
    SetTimer, repeat1, Off
}
return

repeat1:
send, 1
[Mod edit: [code][/code] tags added.]

User avatar
mikeyww
Posts: 26599
Joined: 09 Sep 2014, 18:38

Re: LEARNING AHK for learning purposes need help

Post by mikeyww » 04 May 2021, 13:59

You could provide a description of what you would like to happen. "Randomize" is not enough information to code.

LloydChristmas
Posts: 4
Joined: 05 May 2021, 12:42

Re: LEARNING AHK for learning purposes need help

Post by LloydChristmas » 05 May 2021, 13:18

sorry i didnt mean randomize but i meant to keep it toggled down and not spammin 1 1 1 id rather have it where you hold the key down and then take my finger off to untoggle has of right now im using it and it just keeps pressing1, 1, 1, 1 like that

User avatar
mikeyww
Posts: 26599
Joined: 09 Sep 2014, 18:38

Re: LEARNING AHK for learning purposes need help

Post by mikeyww » 05 May 2021, 14:44

A toggle:

Code: Select all

/::Send % (on := !on) ? "{1 down}" : "{1 up}"
Plain hold:

Code: Select all

/::
Send {1 down}
KeyWait, /
Send {1 up}
SoundBeep, 1000
Return

Post Reply

Return to “Gaming Help (v1)”