It appears that this problem was reported as an issue but unfortunately I
only scanned the outstanding issues so missed it because it had been
closed (issue 1437)
It seems to me that this is going to be an ongoing problem for a while until the library authors find time to modify their code to handle the new Proccessng event model.
Looking at the source code it appears that the processing.Event class has an attribute:-
My idea is to use the new methods register("mouseEvent", this) to capture the Processing events then forward the native object onto the controls.
This solution (for desktop applications) is simple to implement provided that the native objects inside the Processing event match their AWT counterparts i.e.
Processing Event Native object
MouseEvent java.awt.event.MouseEvent
KeyEvent java.awt.event.KeyEvent
Does anyone know whether this is the casse for all renderers. The comments suggest that OpenGL on the desktop may become NEWT based.
I am not familiar with the NEWT toolkit but my research seems to indicate that the AWT and NEWT toolkits can exist side by side and in particular JOGL can work with both.
Is it the intention of the development team to replace AWT with NEWT when using P2D and P3D or can I rely on the native object mapping above?
It seems to me that this is going to be an ongoing problem for a while until the library authors find time to modify their code to handle the new Proccessng event model.
Looking at the source code it appears that the processing.Event class has an attribute:-
- protected Object nativeObject;
and the method getNative to retrieve it.
- /**
- * Get the platform-native event object. This might be the java.awt event
- * on the desktop, though if you're using OpenGL on the desktop it'll be a
- * NEWT event that JOGL uses. Android events are something else altogether.
- * Bottom line, use this only if you know what you're doing, and don't make
- * assumptions about the class type.
- */
- public Object getNative() {
- return nativeObject;
- }
Currently the G4P library uses the registerMouseEvent, registerKeyEvent methods to capture the AWT mouse and keyboard events then forwards them to the various GUI controls. My idea is to use the new methods register("mouseEvent", this) to capture the Processing events then forward the native object onto the controls.
This solution (for desktop applications) is simple to implement provided that the native objects inside the Processing event match their AWT counterparts i.e.
Processing Event Native object
MouseEvent java.awt.event.MouseEvent
KeyEvent java.awt.event.KeyEvent
Does anyone know whether this is the casse for all renderers. The comments suggest that OpenGL on the desktop may become NEWT based.
I am not familiar with the NEWT toolkit but my research seems to indicate that the AWT and NEWT toolkits can exist side by side and in particular JOGL can work with both.
Is it the intention of the development team to replace AWT with NEWT when using P2D and P3D or can I rely on the native object mapping above?