markszlazak@[EMAIL PROTECTED]
wrote:
> In the following script, a control displays (black box) in each table
> cell once you mouse over the cell. Mouse down on the control to change
> the mode of the table. Drag the mouse over cells in the same column
> then mouseup anywhere in a cell. The mouseup event sometimres fires
> before the selection of table cells by dragging is complete. It's
> im****tant that I stop these "false" mouseup's from firing or
> distinguish them from when I let go of the mouse button.
You might be suffering from key bounce. It happens with switches all the
time. You push a button and think you're making contact once and keeping
the button down you'd expect no mouse up. But, the nature of switches is
that you often get a bounce like a dropped ball doesn't just hit the
ground and stay there, it bounces a few times before settling. Same deal
with switches. I had to build debounce logic into a keyboard driver I
wrote once, although that was in assembler and had a lot more control
over timing than JavaScript would have. The basic principle is that you
ignore up events for a certain amount of time because you know they're
just the bounces. Then after that "blocking" time (we're talking a very
short time here), you look at the state, wait a bit more, check it
again, and then you can be sure of the final state and re-enable
(unblock) the up events. If you see the state is up, then you can
generate an up event (or call your up event handler) because you've
detected a genuine up event.
Now whether all this is coming into play in your situation, and whether
even if it is, you have the level of control that would be needed is a
different story. It's possible of course that Windows already takes care
of such issues. I'm throwing it out there though, and it was fun to
reminisce about the old days of Assembler to myself :-)


|