ControlP5 : isMouseOver test ?

edited April 2014 in Library Questions


I am trying to reproduce this command ( ) to avoid rotation from control peasyCam when the mouse is over a controlP5 group.

My problem is I can't find a way to use isMouseOver() correctly as it always return true...

I reproduced a minimal version of my code :

import controlP5.*;

ControlP5 cp5;
Accordion panelControl;

void setup() {
  size(400, 400);

void draw() {
  if (panelControl.isMouseOver()) {
    println(frameCount, true);
  else { 
    println(frameCount, false);

void initialiseGUI() {
  cp5 = new ControlP5(this);

  Group InitGroup = cp5.addGroup("Initialisation")

    .setPosition(20, 20)
      .setSize(100, 10)
        .setRange(0, 50)

  panelControl = cp5.addAccordion("acc")

what am i doing wrong ?

thanks for your time!


  • Answer ✓

    Hi, a quick fix is to change if (panelControl.isMouseOver()) { to if (cp5.isMouseOver()) {

    which returns true whenever the mouse is on top of a controller.

  • it works perfectly! many thanks!

Sign In or Register to comment.