A_TimeSincePriorHotkey returns higher values than it should. It also seems that it returns correct values if I move the cursor a little between the two clicks of the double-click, just between the confines of the XDblClickDiff and YDblClickDiff rectangle. See code:
#SingleInstance, Force
SysGet, XDblClickDiff, 36
SysGet, YDblClickDiff, 37
SystemDoubleClickTime := DllCall("GetDoubleClickTime")
~LButton::
MouseGetPos, X, Y
IfEqual, A_ThisHotkey, %A_PriorHotkey%
IfLess, A_TimeSincePriorHotkey, %SystemDoubleClickTime%
{
EnvSub, PriorX, %X%
Transform, PriorX, Abs, %PriorX%
IfLessOrEqual, PriorX, %XDblClickDiff%
{
EnvSub, PriorY, %Y%
Transform, PriorY, Abs, %PriorY%
IfLessOrEqual, PriorY, %YDblClickDiff%
SoundBeep
}
}
PriorX = %X%
PriorY = %Y%
ReturnRoman




