tap left shift and r to spam f

Ask gaming related questions
redfoxyboi
Posts: 6
Joined: 29 Apr 2024, 17:43

tap left shift and r to spam f

30 Apr 2024, 12:49

[Mod edit: Removed empty codebox.]

hi, im new to AHK and i have a question
what i basically want to do if if i tap left shift and r i want it to spam f, but left shift is my sprint button. essentially i want to be sprinting while tap r it toggles spamming f. but when the spam f is enabled it stops my sprint so i am unable to sprint when the code is active. is there any fix for this?


[Mod edit: Changed topic subject 'scripting to smth more descriptive.']
Rohwedder
Posts: 7705
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: tap left shift and r to spam f

01 May 2024, 03:01

Hallo,
perhaps?:

Code: Select all

<+r::f
or?:

Code: Select all

#HotIf GetKeyState("LShift","P")
r::f
#HotIf
redfoxyboi
Posts: 6
Joined: 29 Apr 2024, 17:43

Re: tap left shift and r to spam f

01 May 2024, 14:27

it would be something close to this, i figured out what id need to do
essentially, i want to click shift and r, the result of this would be left shift being held and f being spammed. but then after i press shift r again it would stop spamming f, (i think i would only need to press r bc the code is holding left shift technically, correct me if im wrong)
sorry for the complication lol i dont really know what im doing
redfoxyboi
Posts: 6
Joined: 29 Apr 2024, 17:43

Re: tap left shift and r to spam f

01 May 2024, 14:32

Code: Select all

LShift & r:: {
 SetKeyDelay 50
 While GetKeyState("r", "P") && GetKeyState("Lshift", "P")
  SendEvent 'shift down'
  SendEvent 'f'
}
i thought it would be something like this, but for some reason it sends the text shiftdown instead of holding shift.
Rohwedder
Posts: 7705
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: tap left shift and r to spam f

02 May 2024, 00:00

Then try:

Code: Select all

#Requires AutoHotkey v2.0
<+r:: { ; LShift & r
 SetKeyDelay 50
 While GetKeyState("r", "P") && GetKeyState("Lshift", "P")
  SendEvent "{Blind}f"
}

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 10 guests