Disable Left Click while holding Y

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Gaspargg
Posts: 2
Joined: 09 Jul 2018, 07:30

Disable Left Click while holding Y

16 May 2021, 04:29

Hi, i'm running into a problem. I can't figure out how to disable My Left Click while y is pressed.
This is my code :

Code: Select all

loop{
	if (GetKeyState("y","P")){
	; disable LButton.
	SendInput u
	sleep 10
	SendInput {a down}
	ypressed = true
	}
	if (ypressed == true) {
	KeyWait, "y", "R"
	SendInput {a up}
	SendInput u
	ypressed = false
	; enable LButton.
	}

}
Could someone help me please ;)
Rohwedder
Posts: 7701
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Disable Left Click while holding Y

16 May 2021, 05:36

Hallo,
try:

Code: Select all

~*y::
Hotkey, *LButton, Return, On
SendInput u
sleep 10
SendInput {a down}
Return:
Return
~*y Up::
Hotkey, *LButton, Return, Off
SendInput {a up}
SendInput u
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: changlish76, peter_ahk, Rohwedder and 114 guests