Jump to content

MouseClickDownDelay not affecting down delay


Recommended Posts

Hello there!

I have been experimenting with automating google sheets with ControlClick and have a small issue where sometimes it clicks and sometimes it doesn't. I figured this was because the click was happening too fast for the website to register it (Adding a snipper that times the click shows it happen ~80-100 times per second). I was reading the docs and saw that there's "MouseClickDelay" and "MouseClickDownDelay" that may help solve my issue.

MouseClickDelay, as explained in the docs adds delay after the click, which works just fine with the syntax

Opt("MouseClickDelay", "100")

or

AutoItSetOption ("MouseClickDelay","100")

 

When I try using MouseClickDownDelay however, absolutely no changes happen and the console still prints out the same click speed no matter the value I give it. Here's the test script:

 

#include <MsgBoxConstants.au3>
#include <Misc.au3>

#RequireAdmin

;Opt("MouseClickDelay", "100")
;Opt("MouseClickDownDelay", "100")
;AutoItSetOption ("MouseClickDelay","100")
AutoItSetOption ("MouseClickDownDelay","100")

ControlClick("","","","left",1,75,253) ; Click on the row A column 2 once

I attempted using 100 without quotation marks but no luck, is this a bug or am I missing something?

Link to post
Share on other sites
Link to post
Share on other sites
6 minutes ago, Nine said:

Since your ControlClick does not provide Windows nor Control info, why don't you use MouseClick ?

Ah yes sorry I should've added more details about that, I have tried to get ControlClick working by specifying window title, control info, instance ID etc and have not been able to get any results out of it. The only case where ControlClick actually clicked once was with the ControlClick("","","","left",1,x,y) configuration. I wanted to try and get it clicking consistently with the MouseClickDownDelay before figuring out how to use window / control info properly (as to not get bad feedback where the script actually works but refuses to click)

Link to post
Share on other sites

Yes, it seems that MouseClickDownDelay does not apply to ControlClick :

Opt("MouseClickDownDelay", 250)
Local $hTimer = TimerInit()
ControlClick("", "", "", "left", 1, 100, 100)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

$hTimer = TimerInit()
MouseClick("left", 200, 200, 1, 0)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

Opt("MouseClickDownDelay", 10)
Opt("MouseClickDelay", 250)

$hTimer = TimerInit()
ControlClick("", "", "", "left", 2, 100, 100)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

$hTimer = TimerInit()
MouseClick("left", 200, 200, 2, 0)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

And ControlClick is not reacting the same as MouseClick with MouseClickDelay. 

Not sure if all this is a bug or not...

Link to post
Share on other sites
Just now, Nine said:

Yes, it seems that MouseClickDownDelay does not apply to ControlClick :

Opt("MouseClickDownDelay", 250)
Local $hTimer = TimerInit()
ControlClick("", "", "", "left", 1, 100, 100)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

$hTimer = TimerInit()
MouseClick("left", 200, 200, 1, 0)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

Opt("MouseClickDownDelay", 10)
Opt("MouseClickDelay", 250)

$hTimer = TimerInit()
ControlClick("", "", "", "left", 2, 100, 100)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

$hTimer = TimerInit()
MouseClick("left", 200, 200, 2, 0)
ConsoleWrite (TimerDiff($hTimer) & @CRLF)

And ControlClick is not reacting the same as MouseClick with MouseClickDelay. 

Not sure if all this is a bug or not...

Interesting, so does ControlClick not technically classify as a click and therefore is unaffected by MouseClickDownDelay?

This doesn't really make sense seeing as the name of the options are "MouseClickDelay" and "MouseClickDownDelay" where the former does affect ControlClick but not the latter. Is there a way to achieve the same affect as MouseClickDownDelay in some way together with ControlClick?

Link to post
Share on other sites
3 minutes ago, Nine said:

And ControlClick is not reacting the same as MouseClick with MouseClickDelay.

This is odd, I get the exact same results with ControlClick and MouseClick in terms of CPS (clicks per second, according to the timer) with MouseClickDelay, what timings are you getting?

Link to post
Share on other sites

Please do not quote every thing I said.  I know what I have just told you.  It makes the topic cumbersome for nothing. Use the reply box at the bottom of the thread instead.

With MouseClick it is 2 times the delay (about 500ms) and with ControlClick 1 time delay (250ms), based on the script I post.

Link to post
Share on other sites
9 minutes ago, kibr said:

Is there a way to achieve the same affect as MouseClickDownDelay in some way together with ControlClick?

I do not think at any way...You can open a ticket in Bug Tracker if you wish to.  It may be a bug after all.

Edited by Nine
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...