My question is if it is also possible get notified of the mouse events inside the native window created by the app? I was looking for a way how to wrap a NativeWindow instance around the existing native window but did not find any way how to do it.
Yes, but the native app which I am not in control of does not give me access to the mouse/keyboard neither.
I am not using any AWT so i can't use awt mouse listeners. The AWT system event queue do not receive any events related to the native window. The only info about mouse which I can get is from java.awt.MouseInfo, but it does not provide access to mouse button statuses, just the possition :(
If you don't use NEWT GLWindow, AWT GLCanvas, SWT GLCanvas or Swing GLJPanel, JOGL won't have access to the mouse events. There is no API in JOGL to get the mouse events of a window not created by JOGL and it's not going to change any time soon for security reasons. Maybe you can use JInput to get the mouse button statuses.
I understand the security concers. But maybe just the window of the GL context you can attach to? If you can render to a surface, I don't see as a security issue being able to listen to it's mouse events...
If the window hasn't been created by JOGL even though JOGL "knows" its OpenGL external context, there is no mean of obtaining its mouse events. There is nothing magic, JOGL is able to manage only the events of the windows it creates that it passes to its listener. Maybe you can wrap the window created by your native C++ code into a proxy surface by using this method, see how it is used in our SWT canvas, you'll have a chance to get the mouse events. You have to find how to use this proxy surface to create a NEWT window and then you'll be able to add a mouse listener into it.
I plan to implement a new input API for NEWT but only focused NEWT windows will be managed.