Login  Register

Re: Making a NEWT mouse-drag continue through a mouse-exit

Posted by Sven Gothel on Nov 13, 2013; 5:52pm
URL: https://forum.jogamp.org/Making-a-NEWT-mouse-drag-continue-through-a-mouse-exit-tp4030617p4030619.html

On 11/13/2013 04:56 PM, stacktracer [via jogamp] wrote:

> We recently switched from JOGL 1 to JOGL 2 at work, and have been running into
> issues with
> mouse-drag events when the mouse gets dragged from inside a NEWT canvas to
> outside it. It
> seems like the drag ought to continue, even while the mouse is outside the
> canvas, but
> instead the canvas stops getting drag events as soon as the mouse exits, even
> if the mouse
> button is still pressed. We see this up through at least JOGL 2.1.2.
>
> We would like to chip in and try to fix the issue, if we can. It's obvious
> there's some
> history (1
> <http://forum.jogamp.org/JOGL-661-Wrong-mouseDragged-event-send-by-newt-td3724002.html>,
> 2 <https://jogamp.org/bugzilla/show_bug.cgi?id=556>, 3
> <https://github.com/sgothel/jogl/commit/8b0aa0e7653f74e713880e77f9afbe59caff38f0>)
> behind the current behavior, though, so it seems like we should start by
> asking for input.
>
> Specifically, we would like to get NEWT mouse-drags to work like AWT/Swing/SWT
> mouse-drags --
> if the mouse is being dragged, and goes outside the bounds of the component,
> the component
> continues to receive drag events (and, notably, the mouse-up event at the end
> of the drag).
>
> 1. Has "continue drag on exit" behavior been deliberately avoided in NEWT for
> some reason?
We have changed the pointer/mouse even processing in a way
that all is done for all platform in the methods:

- WindowImpl.doPointerEvent(..)
  - 1st pass - directly invoked by event source

- WindowImpl.consumePointerEvent(..)
  - 2nd pass - before delivery

I have added more detailed impl. documentation:
  <http://jogamp.org/git/?p=jogl.git;a=commitdiff;h=937b29bc3b3d33d2928956ceacbfe55ef77346de>

"continue drag on exit" has simply not been considered [yet],
however it makes sense - and if nobody disagrees I would accept such behavior.

>
> 2. Does implementing continue-drag-on-exit in NEWT sound possible? (Or
> prohibitively difficult? Or totally hopeless?)

Nothing is impossible.

Right now exterior pointer/mouse events maybe discarded in the native methods (Windows touch),
which action we simply can remove (since it is touched).

Both doPointerEvent(..) and consumePointerEvent() shall tolerate the dragged exterior events,
which is possible, since we track the 'pointer down' state.

Hence it should be fairly simple, 'just' needs
  - implementation
  - unit tests

Do you like to volunteer ?

I will create a bug report regarding this issue.

>
> 3. Is there something fundamental about NEWT that makes continue-drag-on-exit
> harder to achieve in NEWT than in, say, AWT?

Dunno the AWT implementation - but see above.




signature.asc (911 bytes) Download Attachment