Loading...
Logo
Processing Forum
Hi All.

I have been using processing for some time (both mac and windows) however I have just started having problems with the mousePressed() function on my Mac.

On my Macbook when I click the mouse, mousePressed seems to be called twice. I have a print statement inside the mousePressed event. When I click in my application I get "Mouse Event" printed out twice on the console (and Yes, I am only pressing the mouse once, I am *not* double clicking!).

I have a work around but its a bit of a hack. Any ideas are welcome 

Thanks in advance,
Michael 

Copy code
  1. void mousePressed() {
  2.    println("Mouse Event");
  3.    switch(holdData){
  4.      case(0):
  5.        holdData = 1;
  6.        break;
  7.      case(1):
  8.        holdData = 0;
  9.        break;
  10.    }
  11. }

Replies(4)

Hmm... that's odd. I use a Mac and Windows with Processing too and nothing like that has ever happened when on the Mac. I've run your code and I can't reproduce your problem...

TheGamersHaven
I have the same problem 
Here, MacBookPro Retina osX 10.8.4 I didn't got this behaviour... everything worked as expected...

Copy code
  1. void draw(){} // keep it running...
  2. void mousePressed() {
  3.    println("Mouse Event at frame number: " + frameCount );

  4. }