1

I'm simulating a double click programmatically and I want to have a slight pause between both clicks in order to better simulate a real user.

I know the interval should be less than GetDoubleClickTime but am not sure what would be a good time to choose. Does anyone know of any data on how fast a typical person performs a double-click?

I was thinking in the direction GetDoubleClickTime()/3 but of course the magic number seems a bit iffy.

Motti
  • 323
  • 2
  • 8

3 Answers3

3

Fire up an audio recording program in a quiet space and double click your mouse a few times. The time distance between the two peaks is how long it takes. If you're feeling really intense, you can calculate the statistical deviation among many clicks.

Me? I'd go with your thought of GetDoubleClickTime()/3. I think you're over-analyzing a double click.

2

Does anyone know of any data on how fast a typical person performs a double-click? - doubleclick interval is an adjustable OS user setting.

Our user might not have configured his machine typically.

I don't know what's the issue with GetDoubleClickTime() / 3. Even if there was some research proving that an average person doubleclicks 2.56768 time faster than the required minimum speed - 2.56768 is still a magic number of sorts...

1

You could do something really fancy, like:

(GetDoubleClickTime() * 2 / 3) + (rand(0, (GetDoubleClickTime() / 2)) - (GetDoubleClickTime() / 4))

But I kinda agree with Jeff. Since catching double clicks is an OS task; and it just comes back to your program as "the user double clicked at (x, y)" I think you might be over-working this a bit.

The simplest way to simulate clicks is to call the handler directly.

Scivitri
  • 111
  • 2