# G4P with P2D/P3D :: Processing bug

**URL:** https://discourse.processing.org/t/g4p-with-p2d-p3d-processing-bug/5889
**Category:** Libraries
**Created:** [November 24, 2018, 4:41pm UTC](https://discourse.processing.org/t/g4p-with-p2d-p3d-processing-bug/5889 "2018-11-24T16:41:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [November 24, 2018, 4:41pm UTC](https://discourse.processing.org/t/g4p-with-p2d-p3d-processing-bug/5889/1 "2018-11-24T16:41:54Z")

</div>

If you use G4P together with P2D/P3D you might have experienced problems with the controls not responding to the mouse. It has taken me ages to track down the problem but I have found it. G4P uses the cursor(…) method to changed the mouse icon when it moves over the control. Unfortunately using cursor(…) with P2D/P3D generates a fake MouseEvent.ENTER which is adversely affecting G4P.

Fortunately there is a work around by switching off the mouse over icon change action. It is demonstrated in this sketch

```auto
import g4p_controls.*;

GButton button1;

public void setup() {
  size(200, 200, P2D);
  G4P.setMouseOverEnabled(false); // use this until the bug is fixed
  button1 = new GButton(this, 10, 10, 160, 80, "Mary had a little lamb its fleece was white as snow");
}

public void handleButtonEvents(GButton button, GEvent event) {
  System.out.println(button.getText() + " >>> ");
}

public void draw() {
  background(255, 255, 200);
} 

```

I have posted an [issue](https://github.com/processing/processing/issues/5712) on github.
