NEWT Mouse wheel event (EVENT_MOUSE_WHEEL_MOVED) not generated unless window has focus

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NEWT Mouse wheel event (EVENT_MOUSE_WHEEL_MOVED) not generated unless window has focus

hil23Ak
Thanks for this amazing library, it is wonderful to use!

I have a JDesktopPane that can contain multiple JInternalFrameā€™s which in turn contain a NewtCanvasAWT. I am using an animator and have a newt.event.MouseListener implemented.

If the JInternalFrame/window has focus, the mouse listener for that NewtCanvasAWT's GLWindow will produce all mouse events as expected.

If the mouse hovers over a JInternalFrame/window that does not have focus, it will still produce all mouse events EXCEPT the wheel event (newt.event.MouseEvent.EVENT_MOUSE_WHEEL_MOVED).

This appears to be the same issue brought up in: http://forum.jogamp.org/Another-Newt-mouse-event-question-td4026976.html

To my experience, default Java behavior (java.awt.event.MouseEvent, java.awt.event.MouseWheelEvent, etc.) is to deliver the event to a visible component if it has the appropriate listener whenever the mouse is hovered above it, regardless of focus. This appears to be broken in the NEWTEvent model for the specific case of EVENT_MOUSE_WHEEL_MOVED.

Is there a technical reason why newt.event.MouseEvent has to behave this way? Is there any work around to this issue?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: NEWT Mouse wheel event (EVENT_MOUSE_WHEEL_MOVED) not generated unless window has focus

gouessej
Administrator
It seems to be inconsistent but maybe we're missing something important. Feel free to make a request for enhancement, fill a bug report.
Julien Gouesse | Personal blog | Website