G4P issues with Processing

G4P is a large complex library and there are areas that it doesn't work well with Processing. This page identifies known problem areas and where possible provides a work-around .

Mouse cursor and OpenGL

By default G4P changes the mouse icon when it moves over a control but when using OpenGL (P2D/P3D) calling the setCursor(...) method Processing fires a phanton ENTERED event. This event affects G4P's event handling to the point controls become unresponsive as if disabled.

Until Processing fix the bug there is a simple work-arround, include the statement

G4P.setMouseOverEnabled(false);

As the second line in setup() immediately after the call to size(...) like this

public void setup() {
  size(200, 200, P2D);
  G4P.setMouseOverEnabled(false); // use this until the bug is fixed
  // rest of your setup code here
}

This problem does not occur using the default JAVA2D renderer.

Post 4.1.5 versions will switch off cursor icon changes until the bug is fixed.

See the Github issue

Keyboard input and OpenGL

When using any of the G4P text controls, GTextarea, GTextfield and GPassword with OpenGL (P2D/P3D) the enter, backspace and delete keys do not fire events so it is impossible to delete characters in these controls. These controls work as expected in JAVA2D mode.

Note: V4.2.3 includes a patch to overcome this issue.

See the Github issue