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

mousePressed not working correctly in Galaxy S2

Open raft75 opened this issue 9 years ago • 2 comments

I have an issue with the following code, copied from http://android.processing.org/tutorials/getting_started/index.html On my Galaxy S3 (Android 4.4.2) it works perfectly, but on my Galaxy S2 (Android 4.1.2) the event mousePressed is not recognized half of the times, so I have to tap the screen twice instead of once. I have also tried a different Galaxy S2, same issue.

void setup() { fullScreen(); noStroke(); fill(0); }

void draw() { background(204); if (mousePressed) { if (mouseX < width/2) { rect(0, 0, width/2, height); // Left } else { rect(width/2, 0, width/2, height); // Right } } }

raft75 avatar Sep 03 '16 13:09 raft75

The problem is related to fullScreen(). If I don't use that, but instead use size(800,480), that is the full screen size of my Galaxy S2, everything works correctly. Of course this is not a good solution because it's the wrong size for most other devices. The workaround I'm using now to have everything work as expected is: void settings() { size(displayWidth, displayHeight); }

raft75 avatar Sep 04 '16 07:09 raft75

Thanks for the report and the workaround. I will look into it.

codeanticode avatar Sep 07 '16 23:09 codeanticode