Rapid Fire while holding Left Ctrl Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Furia782
Posts: 7
Joined: 06 Oct 2022, 13:21

Rapid Fire while holding Left Ctrl

Post by Furia782 » 06 Oct 2022, 13:35

Hello.
I'd like to get help in the script so that when I hold the Left Ctrl key, my left mouse click becomes fast, and getting disabled when I release the Left Ctrl.
Thanks.

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Rapid Fire while holding Left Ctrl

Post by Rohwedder » 07 Oct 2022, 01:50

Hallo,
try:

Code: Select all

*LCtrl::
~*LButton::
While, GetKeyState("LCtrl","P") And GetKeyState("LButton","P")
	SendInput, {LButton}
Return

Furia782
Posts: 7
Joined: 06 Oct 2022, 13:21

Re: Rapid Fire while holding Left Ctrl

Post by Furia782 » 07 Oct 2022, 10:56

Rohwedder wrote:
07 Oct 2022, 01:50
Hallo,
try:

Code: Select all

*LCtrl::
~*LButton::
While, GetKeyState("LCtrl","P") And GetKeyState("LButton","P")
	SendInput, {LButton}
Return
Worked perfectly

It would be possible to create a script that allows me to hold Lshift, and while pressed, would activate Lctrl pressed + left mouse click stay fast, being disabled when releasing Lshift. If possible too, being able to adjust the amount of mouse clicks, like 10 clicks per second or something like that.

This would really help my wrists in Path of Exile game.

Sorry to bother.

Thanks.

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Rapid Fire while holding Left Ctrl

Post by Rohwedder » 07 Oct 2022, 11:57

Then perhaps:

Code: Select all

#InstallKeybdHook
#InstallMouseHook
#IF GetKeyState("LShift","P")
*LCtrl::
~*LButton::
While, GetKeyState("LCtrl","P") And GetKeyState("LButton","P")
{
	SendInput, {LButton}
	ToolTip,% A_TickCount
	Sleep, 100 ;to adjust the amount of mouse clicks per second 
}
Return
#IF
My opinion: It's a waste to block two of the valuable modifier keys for this purpose.

Furia782
Posts: 7
Joined: 06 Oct 2022, 13:21

Re: Rapid Fire while holding Left Ctrl

Post by Furia782 » 07 Oct 2022, 12:39

It doesnt work for what i need. But as you say, its a waste block them.
Maybe some script like this one, but instead of auto clicking, make it manual click with some function sleep to control the ammount of clicks per second.

Code: Select all

#MaxThreadsPerHotkey, 2
SetDefaultMouseSpeed, 0
SetBatchLines, -1
ListLines, Off

F12::
    bFlag := !bFlag
    While bFlag
        Click
Return
[Mod edit: [code][/code] tags added.]

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Rapid Fire while holding Left Ctrl

Post by Rohwedder » 08 Oct 2022, 01:57

Then,
try this Timer:

Code: Select all

F12::SetTimer, F12 Up,% (F12:=!F12)?110:"Off" 
F12 Up::Click %F12% ; on/off, every 110 ms
A Timer is not suitable for very fast repetition rates, because its period (here 110 ms) is typically rounded up to the next multiple of 10 or 15.6 ms (depending on the type of hardware and the installed drivers).

Furia782
Posts: 7
Joined: 06 Oct 2022, 13:21

Re: Rapid Fire while holding Left Ctrl

Post by Furia782 » 10 Oct 2022, 07:52

Thanks man, works so great.
One last ask. Can you do this but with no automatic click? Just rapid click but manual please.
Thank you so much for your time.

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Rapid Fire while holding Left Ctrl  Topic is solved

Post by Rohwedder » 11 Oct 2022, 00:55

This?:

Code: Select all

#InstallMouseHook
F12::SetTimer, F12 Up,% (F12:=!F12)?110:"Off" 
F12 Up::Click,% F12&&GetKeyState("LButton","P")
; on/off, every 110 ms if LButton down

Furia782
Posts: 7
Joined: 06 Oct 2022, 13:21

Re: Rapid Fire while holding Left Ctrl

Post by Furia782 » 14 Oct 2022, 08:54

Thank you so much for your attention. You help me a lot.
My hand alrelady get better a little bit.

Post Reply

Return to “Gaming Help (v1)”