I prefer sometimes controlclick just because I can't see how the mouse moves and it looks somehow better.
Code: Select all
ControlClick, x720 y486, ahk_class MozillaWindowClass,,Left,1,NA
Code: Select all
Click 720, 486
Code: Select all
ControlClick, x720 y486, ahk_class MozillaWindowClass,,Left,1,NA
Code: Select all
Click 720, 486
Code: Select all
DllCall("QueryPerformanceFrequency",Int:="Int64*",Freq),Time:=Count:=0
q::
DllCall("QueryPerformanceCounter",Int,Count1)
;Time duration measurement of this:
ControlClick, x720 y486, ahk_class MozillaWindowClass,,Left,1,NA
; Click 720, 486
;Multiple execution increases accuracy by means of averaging!
DllCall("QueryPerformanceCounter",Int,Count2)
ToolTip,% "Time: " Round((Time+=(Count2-Count1)/Freq*1.E6)/++Count) " µs"
Return
So, ControlClick is usually almost 3x faster, did I understand it correctly? Just wanted to make sure:) Thank you RohwedderRohwedder wrote: ↑22 May 2022, 00:25Hallo,
not here: Click 68ms
ControlClick 27msProbably because ControlClick does not need to move the cursor.Code: Select all
DllCall("QueryPerformanceFrequency",Int:="Int64*",Freq),Time:=Count:=0 q:: DllCall("QueryPerformanceCounter",Int,Count1) ;Time duration measurement of this: ControlClick, x720 y486, ahk_class MozillaWindowClass,,Left,1,NA ; Click 720, 486 ;Multiple execution increases accuracy by means of averaging! DllCall("QueryPerformanceCounter",Int,Count2) ToolTip,% "Time: " Round((Time+=(Count2-Count1)/Freq*1.E6)/++Count) " µs" Return
Just tried your script. Wonderful. From my side, it seems like click is faster than controlclick in most cases, and idk why. Click's performance is sometimes 2ms. Controlclick should have actually been faster, as you have said "it doesn't need to move the cursor"
Is there a small mistake? Shouldn't q be at the top of the code?Rohwedder wrote: ↑22 May 2022, 00:25Hallo,
not here: Click 68ms
ControlClick 27msProbably because ControlClick does not need to move the cursor.Code: Select all
DllCall("QueryPerformanceFrequency",Int:="Int64*",Freq),Time:=Count:=0 q:: DllCall("QueryPerformanceCounter",Int,Count1) ;Time duration measurement of this: ControlClick, x720 y486, ahk_class MozillaWindowClass,,Left,1,NA ; Click 720, 486 ;Multiple execution increases accuracy by means of averaging! DllCall("QueryPerformanceCounter",Int,Count2) ToolTip,% "Time: " Round((Time+=(Count2-Count1)/Freq*1.E6)/++Count) " µs" Return
Code: Select all
q::
DllCall("QueryPerformanceFrequency",Int:="Int64*",Freq),Time:=Count:=0
DllCall("QueryPerformanceCounter",Int,Count1)
;Time duration measurement of this:
;ControlClick, x722 y487, ahk_class MozillaWindowClass,,Left,1,NA
Click 722, 487
;Multiple execution increases accuracy by means of averaging!
DllCall("QueryPerformanceCounter",Int,Count2)
ToolTip,% "Time: " Round((Time+=(Count2-Count1)/Freq*1.E6)/++Count) " µs"
Return
No, he made no mistake. You would be making the mistake by moving it. You are not understanding how it works and why that line can’t be in the hotkey subroutine for it to work as intended. That line gets executed upon script start, and if it were in the hotkey subroutine, then Time and Count would get reset every time and would not perform the averaging that the comment in his script points out is being performed.