http://forum.jogamp.org/Making-a-NEWT-mouse-drag-continue-through-a-mouse-exit-tp4030617.html We 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, 2, 3) behind the current behavior, though, so it seems like we should start by asking for input. 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> 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). +++ Pointer/Mouse events are processed platform agnostic 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. +++ 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. Support of this enhancement requires: - Specification (above description seems to be sufficient) - Implementation - Unit tests
On X11 no extra native code was required, i.e. drag events are received even if pointer is in exterior of the window. Windows behaves different: - Native code for touch processing is required to deal w/ exterior dragging - Mouse move/release when exterior of the window is not 'just' received. OSX: TBD ..
(In reply to comment #1) > On X11 no extra native code was required, i.e. drag events are received > even if pointer is in exterior of the window. > > Windows behaves different: > - Native code for touch processing is required to deal w/ exterior dragging > - Mouse move/release when exterior of the window is not 'just' received. We have to SetCapture(HWND) on MOUSE_MOVE if BUTTON is PRESSED and ReleaseCapture() when no more buttons are pressed or leaving focus. > > OSX: TBD ..
(In reply to comment #2) > > > > OSX: TBD .. On OSX no extra native code was required either, i.e. drag events are received even if pointer is in exterior of the window.
- Support 'Continue Drag on Exit' - Track dragging operation, allow exterior dragging - Hence track EXIT (see below) - Windows: - Capture mouse for exterior dragging - Only 'NewtWindows_trackPointerLeave' if 'entering' - Simplify touch: No 'inside' check - Not required. - Consistent Mouse ENTER/EXIT - Track ENTER/EXIT and synthesize if required, drop duplicate - OSX benefits, since it never produced ENTER/EXIT events - AWT (or other TK) translated events beahve equal now. - Required for EXIT event after ending exterior dragging and final RELEASE Tests: Passed unit tests 'junit.run.newt.event' on - GNU/Linux - Windows7 - OSX 10.7 Tested exterior tracking manually w/ NEWT TestGearsES2NEWT and TestGearsES2NewtCanvasAWT: - GNU/Linux - Windows7 (mouse) - Windows8.1 (touch) - OSX 10.7