processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

mousePressed() not working well

Open codeanticode opened this issue 9 years ago • 4 comments

Ported from https://github.com/processing/processing/issues/4246

codeanticode avatar Jan 25 '16 22:01 codeanticode

Thanks for porting my post to the correct place. Is Android Mode correctly working for anyone with Android 4.1+?

94Conti avatar Jan 26 '16 12:01 94Conti

Sure, no problem.

I have been using the mode on 4.1+ and 5.x devices.

codeanticode avatar Jan 26 '16 20:01 codeanticode

I have installed the drivers, and try it with both Samsung Galaxy S3 Neo and Samsung Galaxy Tab 3... do you know what can I have done wrong? It's everything working, just that failing... maybe I forgot to install something? Thanks!

94Conti avatar Jan 26 '16 21:01 94Conti

@94Conti The problem is with the code given in the example. When you click on the rectangle or circle, mousePressed() is called before update() inside draw() could be called. So both circleOver and rectOver are false and currentColor does not get updated. This could easily be solved if you call update() inside mousePressed() to set the variables before their value is checked. Hope this helps :)

suheb avatar Feb 05 '16 08:02 suheb