MouseMoveEvents

Eddie Cottongim cottonsqueak at earthlink.net
Tue Aug 12 18:11:00 UTC 2003


While I was trying to use MouseMoveEvents I noticed something I don't
understand.

You can query a MouseMoveEvent for its starting and ending points. If I move
the mouse slowly, I'm finding that startingpoint always equals endingpoint.
I understand that occasionally zero-length moves may come in. What I mean is
that starting point is never different from ending point, even though the
mouse has moved.

Here's what I mean. The events coming in look like this:
starting            ending
148 at 148        148 at 148
149 at 148        149 at 148
150 at 148        150 at 148

If the mouse has moved, shouldn't starting point be different than ending
point for at least one of the mouseMoves?

One way you can check this out is by adding this statement to
HandMorph>>handleEvent:, preferably inside the ShowEvents block so you can
turn it on and off  with "HandMorph showEvents: true":

(evt isKindOf: MouseMoveEvent ) ifTrue:[ ((evt startPoint)~=(evt endPoint))
ifTrue:[self beep] ].

This will beep when a non-zero length mouseMove comes in. If I move the
mouse slowly, this never happens! If I move it quickly, the beeps happen
frequently, which is what I expect.

Is this intended?

Eddie

PS.  Ok, for fun I turned ON the higherPerformance preference. Now, the
startingPoint=endingPoint practically all the time, regardless of how fast I
move the mouse. with higherPerformance on I would expect the moves to be
perhaps smaller, but still, it seems like the mouseMoves should report a
delta occasionally at least.










More information about the Squeak-dev mailing list