Do we need a mouse trap?

Adrian Hey ahey@iee.org
Sun, 07 Mar 1999 23:56:28 +0000 (GMT)


On Fri 05 Mar, Peter Achten wrote:
> >I suppose one of my questions is should ObjectIO issue multiple
> >(I.E. ~hundreds per second) calls to the mouse function even if the
> >mouse hasn't moved or clicked or changed state in any way? I can't
> >see what possible use this is so I would expect ObjectIO not to do it.
> >If this assumption is correct then my mouse_trap function should be
> >unnecessary. Hence the question: Do we need mouse traps?
> 
> The object I/O library should not make (to many) assumptions on
> application requirements. In most cases I guess you are right. In fact
> my favourite mouse filter is (\m->get MouseStateButtonState m==ButtonDown).
> For this reason the MouseStateFilter has been introduced to give
> programmers an easy means to filter out uninteresting mouse events,
> as your example elegantly illustrates. 

I see, this is a feature not a bug :-)

Thanks for the upgrade, that seems to work ok now and I can even get the
life game example to stop crashing, but only if I put in a mouse_trap, it
still crashes without it :-(

I still have a few minor gripes about the way ObjectIO deals with the mouse
on the Mac (I can't comment about PC platforms). These aren't particularly
serious problems but you might like to give the matter some consideration
for the next release of ObjectIO.

Gripe 1
-------
I still don't like getting multiple mouse calls even if the mouse state
hasn't changed. Evidently the life game example doesn't like it much either.

Gripe 2
-------
If you disagree with me regarding Gripe 1 then shouldn't the repeat rate
of mouse calls be programmable? The ObjectIO defaults are unlikely to be
the best choice for all users who might need this feature. (Although I
suspect there aren't any. Those that do need to repeat some function in
the absence of mouse state changes are probably better off using a timer.)

Gripe 3
-------
It appears that (on the Mac) the mouse is handled by periodically
polling the mouse status and reporting the results via the MouseFunction.
Why is the polling rate so much slower when the mouse button is up?
If I implement a simple 'rubber banding' line drawing routine using xor
mode draws, the update rate is irritatingly sluggish with MouseMove but
nice and responsive with MouseDrag.


In short, I suppose my point of view could be simply stated as:

 "If the mouse hasn't changed state I don't want to know about it, but if
 it has I want to know as soon as possible."

I believe that I probably speak for the 'silent majority' of ObjectIO
users here. If there's anybody out there who strongly agrees/disagrees
with my opinions then perhaps now is a good time speak up. 

Regards
-- 
Adrian Hey