We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › MouseEvents and ControlP5
Page Index Toggle Pages: 1
MouseEvents and ControlP5 (Read 2021 times)
MouseEvents and ControlP5
Apr 6th, 2009, 11:05am
 
Hi, I'm trying to implement a color picker of a webcam image (using JMyron) and using a controlP5 slider to change other values.

The only problem is that I when introducing mouse events into the sketch, the sliders are unclickable. I'm a beginner to processing/java and I'm unsure about how I should go about this.

Here is the code, any help/feedback is greatly appreciated:

http://michaeldoyle.eu/calib.pde
Re: MouseEvents and ControlP5
Reply #1 - Apr 7th, 2009, 5:34am
 
Found a quick fix for this, set the mouse event method to check for a double click Smiley

Code:
void mouseClicked(MouseEvent m) {
if (mouseEvent.getClickCount() == 2) {
Re: MouseEvents and ControlP5
Reply #2 - Apr 7th, 2009, 6:46am
 
another idea would be to exclude the region where your sliders are.
As you normaly put them on the left/right side or in one of the corners
just add something like this arround it.

if(mouseX>100 && mouseY<height-100){

}
Re: MouseEvents and ControlP5
Reply #3 - Apr 7th, 2009, 9:41pm
 
hi,
you can use
boolean b = controlP5.window(this).isMouseOver(); // returns true or false
which checks if the mouse is inside/over a controller.
or you can hide the controllers with Alt+h while doing other mouse related operations.
hope this helps, best,
andreas
Re: MouseEvents and ControlP5
Reply #4 - Apr 10th, 2009, 1:13pm
 
Thanks for the help guys, those methods are better than my own. Thanks again!
Page Index Toggle Pages: 1