Another Newt mouse event question

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

Another Newt mouse event question

gsxruk
Hi,

I have a GLWindow and NewtCanvasAWT used with a JFrame.  The GLWindow has a Newt mouse listener attached and the JFrame has a JMenu.  To test this issue, the mouse listener is currently responding to mouseEntered, mouseExited and mouseWheelMoved events.

When the application is first executed and the window appears, if the mouse is moved inside and outside the canvas area, the mouse events are received.  Similarly, if the mouse wheel is moved within the canvas area, mouse events are also received.

However, if the JMenu is opened and closed and the mouse is returned to the canvas area, only the mouseEntered and mouseExited events continue to be received.  Any movement of the mouse wheel does not cause any events.  To start receiving mouse wheel events it is necessary to click inside the window.

Is this expected behaviour and if so, what's the best way to resolve this without the need to click inside the window?

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

Re: Another Newt mouse event question

Rami Santina
Administrator

most probably, you need to give your canvas focus on menu exit.

Reply | Threaded
Open this post in threaded view
|

Re: Another Newt mouse event question

gsxruk
I'd agree with you.  Seems strange though that other mouse events continue to be delivered to the component except for the wheel event.