While GetKeyState multiple keys? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
rover200vi
Posts: 2
Joined: 20 Oct 2017, 16:08

While GetKeyState multiple keys?

20 Oct 2017, 16:23

Hello Guys, I created a macro like this:

Code: Select all

MButton::
While GetKeyState("MButton","P")
{
	Click
	sleep 40
}
This problem is if I hold a key on my keyboard and then hold the MButton it won't register?

While this code works fine even if I press multiple keys and then the MButton but I have other issues with this code.
#IfWinActive does not work for me with this code below.

Code: Select all

MyLabel:
Loop
{
    GetKeyState, state, Mbutton
	if state = D
	{
		loop
		{
			click
			Sleep, 40
			Goto, MyLabel
		}
	}
}
User avatar
Nextron
Posts: 1318
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: While GetKeyState multiple keys?  Topic is solved

20 Oct 2017, 17:16

rover200vi wrote:if I hold a key
Specifically a modifier key like Ctrl or Shift? Your hotkey triggers exclusively to MButton, to make it trigger on any combination of keys with it, prepend it with a *, as in *MButton::.
rover200vi
Posts: 2
Joined: 20 Oct 2017, 16:08

Re: While GetKeyState multiple keys?

20 Oct 2017, 17:54

Thanks that worked.

Return to “Ask For Help”

Who is online

Users browsing this forum: colt, Google [Bot], ineuw, Regath, vvhitevvizard and 43 guests