On 7/12/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
The only question is whether we should implement some form of
backwards compatibility to the way that 1.0 was working.  I don't
recall what 1.0 did, my guess is that used the button of the last
pressed mouse button.  If this is the case then we'd need to cache the
last button pressed in EventQueue.

Reviewing the old osgProducer::EventAdapter shows that it was storing
the last button pressed in a static variable and copying this into the
mouse motion event.  This was something do by a copyStaticVariables()
method that was done for all event types.

This practice will actually produce some misleading results though,
for instance if you press the left mouse button, then the right and
then move the mouse the event you'll get for the mouse move will have
the right mouse button as the button - this is not too bad, but if you
then release the left mouse button the and then drag the drag event
will now have the button set to left mouse button since that was the
left mouse button event, but it'll be totally misleading, in the
context of the mouse button.

This makes me wonder if actually trying to maintian consitency of
behavior will be a bug - it can lead to misleading usage which in turn
can leads to bugs.

Ideally it shouldn't be possible to test the button value for events
that its inapprorpriate for, but alas with the way that
GUIEventAdapter is implemented as a catch all container its not
possible.

Perhaps a fallback would be to have a flag setting for each for key
and button value get methods that emits a warning when the value is
not approrpriate for that event.  This obviously complicates the
implementation of GUIEventAdapter but would at least give developers a
clue to why there application is misbehaving.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to