While GetKeyState multiple keys? Topic is solved

Get help with using AutoHotkey (v1.1 and older) 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: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 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 (v1)”

Who is online

Users browsing this forum: cjsmile999 and 376 guests