Simulate CTRL+Double-Click with Middle-Click [SOLVED]

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
chinagreenelvis
Posts: 133
Joined: 19 Oct 2015, 16:21

Simulate CTRL+Double-Click with Middle-Click [SOLVED]

19 Oct 2015, 16:27

All I want to do is simulate either CTRL+double-click or CTRL+enter by double-clicking the middle mouse button in Windows Explorer. I'm trying to get a double-middle-click to open folders in a new window.

So far I can simulate a left-click:

Code: Select all

#IfWinActive ahk_class CabinetWClass
~MButton::
if (A_PriorHotkey <> "~MButton" or A_TimeSincePriorHotkey > 200)
{
	KeyWait, Esc
    return
}	
SendInput {LButton}
return
Nothing else I add to this seems to do the trick. I've tried

Code: Select all

SendInput {LButton}{Ctrl Down}{Enter}{Ctrl Up}
It only seems to be sending the {Enter} and not the CTRL press.
Last edited by chinagreenelvis on 19 Oct 2015, 18:29, edited 1 time in total.
Heezea
Posts: 59
Joined: 30 Sep 2013, 21:33

Re: Simulate CTRL+Double-Click with Middle-Click

19 Oct 2015, 17:53

Try this:

Code: Select all

#IfWinActive ahk_class CabinetWClass
~MButton::
	if (A_PriorHotkey <> "~MButton" or A_TimeSincePriorHotkey > 200)
	{
		KeyWait, Esc
		return
	}	
	SendInput {LButton}
	Sleep 100
	Send ^{Enter}
return
chinagreenelvis
Posts: 133
Joined: 19 Oct 2015, 16:21

Re: Simulate CTRL+Double-Click with Middle-Click

19 Oct 2015, 18:29

Thanks. That produced inconsistent results, but it got me to the solution:

Code: Select all

#IfWinActive ahk_class CabinetWClass
~MButton::		
	if (A_PriorHotkey <> "~MButton" or A_TimeSincePriorHotkey > 200)
	{
		KeyWait, Esc
		return
	}	
	Send {Click}
	Sleep 100
	Send ^{Enter}
return
Also, it turns out the real problem is that I needed to delete the following line from the new script file (provided by the template):

Code: Select all

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 175 guests