Need help with custom Mouselook Toggle script

Ask gaming related questions
BellewTheBear
Posts: 1
Joined: 12 Aug 2019, 05:10

Need help with custom Mouselook Toggle script

22 Oct 2019, 11:19

I'm looking for help with a custom Mouselook Toggle script. What I'd like is script that allows me to, with a press of the Z key, toggle right mouse being held down, while also changing left and right mouse clicks to key presses while active. Then when I hit the Z key again, right mouse is released and both mouse clicks return to normal. Also, if at all possible I'd like to have the script be disabled while the left ALT key is being held down and then enabled again when ALT is released.

I'm way too new at AutoHotkey to figure this out myself and I would really appreciate any help you guys could offer. Thank you!
User avatar
PipeDreams
Posts: 117
Joined: 19 Dec 2015, 00:20

Re: Need help with custom Mouselook Toggle script

22 Oct 2019, 20:38

This should be enough to get you started. Feel free to modify it as you see fit.

Code: Select all

Loop, ;This Is Just For Proof Of Concept Testing, You Can Delete This Loop.
{	If Ztog
	{	SoundBeep, 500, 50
		Sleep, 500
	}
} Return


~z:: ;This is the toggle switch
{	Ztog := !Ztog ;This Is The Toggle Command.
	If Ztog
	{	Send, {RButton Down}
	} Else,
	{	Send, {RButton Up}
	}
} Return


~Left:: ;Left Arrow For Left Click When Ztog Is Active.
{	If Ztog
	{	Send, {LButton}
	}
} Return


~Right:: ;Right Arrow For Right Click When Ztog Is Active.
{	If Ztog
	{	Send, {RButton}
	}
} Return


~Alt:: ;Hold Alt To Suspend Script, Release Alt To Unsuspends Script. 
{	If Ztog
	{	Send, {RButton Up}
		Ztog := !Ztog
	} Suspend, ON
	KeyWait, Alt ;Waits For The Alt key To Be Released Before Moving To The Next Line.
	Suspend, OFF
} Return


~Esc::ExitApp ;Kill The Scritp

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 12 guests