I am not an expert at it but this is the script I have so far as to demonstrate.
Code:
#NoEnv
#Persistent
#SingleInstance Force
SetTitleMatchMode 3
SetTitleMatchMode Fast
Loop,
{
MouseGetPos,,,ID,NN
WinGetClass,c,ahk_id %ID%
If (c="Progman" AND NN="SysListView321") OR (c="CabinetWClass" AND NN="SysListView321")
Hotkey,*LButton,L1,On
Else If ! (c="Progman" AND NN="SysListView321") OR (c="Progman" AND NN="Edit1") OR (c="CabinetWClass" AND NN="SysListView321") OR (c="CabinetWClass" AND NN="Edit4")
Hotkey,*LButton,L0,Off
} Return
L1:
Hotkey,*LButton,Off
If (A_PriorHotKey=A_ThisHotKey AND A_TimeSincePriorHotkey<300)
Click 2
Else
Click
Return
L0:
Hotkey,*LButton,On
Return
MButton::
MouseGetPos,,,ID2,NN2
WinGetClass,c2,ahk_id %ID2%
If (c2="Progman") OR (c2="CabinetWClass" AND NN2="SysListView321") {
GetKeyState, SL, MButton, P
If SL=D
{
Send {LButton Down}
KeyWait MButton, U T0.35
If ErrorLevel {
KeyWait MButton, U
Send {LButton Up}
}
Else
KeyWait MButton, D
Send {LButton Up}
Return
}
} Return
On running my script try the left click and drag, which is blocked. But you can still double click to open a file.
Now use MButton to drag a file by either click and release then drag OR clcik and drag then release.
The only thing I'm baffled is how to block a LButton slow double click on a file from prompting an edit on a file name.