Script to hold down Left and Right mouse button at the same time. toggle

Ask gaming related questions (AHK v1.1 and older)
Dankukus
Posts: 11
Joined: 23 Feb 2018, 21:52

Script to hold down Left and Right mouse button at the same time. toggle

23 Feb 2018, 22:02

I am very bad at scripting in AHK. I'm wondering if someone can help me with a script so that when I press F4, it holds down the left mouse button and right mouse button at the same time until I press F4 again. Please and thank you :D
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Script to hold down Left and Right mouse button at the same time. toggle

25 Feb 2018, 11:27

Here you go.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
Toggle = 0

F4::
Toggle := !Toggle
If Toggle
	Send, {LButton Down}{RButton Down}
else
	Send, {LButton Up}{RButton Up}
return


esc:: ExitApp ; esc, exits the script

	
I am your average ahk newbie. Just.. a tat more cute. ;)
Dankukus
Posts: 11
Joined: 23 Feb 2018, 21:52

Re: Script to hold down Left and Right mouse button at the same time. toggle

17 Mar 2018, 14:39

thank you! i'm defiently not late lol

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 91 guests