Page 1 of 1

MouseDown Minutia

Posted: Wed Jan 08, 2014 7:31 pm
by dunbarx
Thought I had grokked this, but looking for comfort.

In the card script:

Code: Select all

on mouseDown
      put random(999)
end mouseDown
Click twice quickly, holding down the mouse on the second click (click and hold). If you do it fast enough, so that only one value appears in msg, and then wait a second, a new number will appear in message when you release. The value of the doubleClickInterval makes no difference, though it will make it easy or hard to attain only one value on the fast double click.

So the second mouseDown is queued, depending on when the doubleClickInterval times out?

Craig

Re: MouseDown Minutia

Posted: Thu Jan 09, 2014 3:04 pm
by Mark
Hi Craig,

It is worse. I have the following script:

Code: Select all

on mouseUp
   f
end mouseUp

on mouseDown
   f
end mouseDown

on mouseMove
   f
end mouseMove

on mouseDoubleUp
   f
end mouseDoubleUp

on mouseDoubleDown
  f
end mouseDoubleDown

on f
   put line -2 of the executionContexts & comma & the seconds & cr after msg
end f
While clicking, I make sure that the mouse doesn't move (I use the button next to a trackpad to click, so no mice involved). One single click generates the following:

button id 1003 of card id 1002 of stack "Untitled 1",mouseMove,10,1389273232
button id 1003 of card id 1002 of stack "Untitled 1",mouseDown,6,1389273233
button id 1003 of card id 1002 of stack "Untitled 1",mouseUp,2,1389273233
button id 1003 of card id 1002 of stack "Untitled 1",mouseMove,10,1389273233

If I doubleClick, keep the mouse pressed after the second click and release after two seconds, I get

button id 1003 of card id 1002 of stack "Untitled 1",mouseMove,10,1389274410
button id 1003 of card id 1002 of stack "Untitled 1",mouseDown,6,1389274410
button id 1003 of card id 1002 of stack "Untitled 1",mouseUp,2,1389274410
button id 1003 of card id 1002 of stack "Untitled 1",mouseMove,10,1389274410
button id 1003 of card id 1002 of stack "Untitled 1",mouseDoubleDown,18,1389274410

No mouseDoubleUp is sent, but I'd say that's expected. I am surprised that you observe an extra mouseDown. Do you have a grouped button or another object that might cause the extra mouseDown?

If I use the trackpad instead of the button and doubleClick with a delay before I release the trackpad, I get

card id 1002 of stack "Untitled 1",mouseMove,10,1389275940
card id 1002 of stack "Untitled 1",mouseDown,6,1389275940
card id 1002 of stack "Untitled 1",mouseMove,10,1389275940

Sometimes, the last mouseMove isn't included.

Altogether, I'd say there are a few inconsistencies, the biggest problem for me being the spurious mouseMoves.

kind regards,

Mark

Re: MouseDown Minutia

Posted: Tue Mar 03, 2015 11:37 pm
by billhemsley
Hi,

I too have been having difficulties with this.

I'm getting a mouseMove before a mouseDown (in a single script for a group) on a simple mouse click (definitely not moving). This is consistent with Mark's tests.

Note that within the mouseMove block, a test to see if the mouse is down evaluates to true.

Code: Select all

on mouseDown
    #...
end mouseDown

#This runs first
on mouseMove newMouseH newMouseV
    #This evaluates to true
    if the mouse is down then 
        #...    
    end if
end mouseMove
I can find no documentation that describes the behaviour which, to me at least, is unexpected and confusing.

Is there some clear pattern here? Can anybody explain what's going on?

Thanks,

Bill

Re: MouseDown Minutia

Posted: Wed Mar 04, 2015 5:56 pm
by jacque
I've seen the same thing. Either the engine considers a click to be a kind of movement, or else some mice send that response when the button is pressed.