We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I have developed an application on processing that I am trying to run on a windows tablet. I am facing problems with its touch screen. It does not detect touch properly and misses it generally. When you tap on the button speedily multiple times the tap gets detected. For example, the application runs perfectly fine if I perform all actions using a double tap instead of a single tab. Why is that? Can anyone please help?
I have used mousePressed for detecting touch.
Also when i run it on my computer using a mouse it works fine with a single click.
Answers
I have the exact same problem, and i tried two different computers, both running win8 and the problem is consistent.
If you sweep the button it detects without any problems, but a single press will not work. But by far the worst problem i have encountered are that if you press one button and then after a while presses another one, sometimes the first one gets pressed, even though you are pressing a button at the other end of the screen. It seems like the cursor is still hovering over that button and that the program somehow detects the press before the position.
This made me wonder if processing has some way to force the cursor to a given position. One could make the code in such way, that we don't detect buttonpresses but we detect if the mouse are hovering over the button equivalent to a buttonpress. The cursor will flicker between the point on the screen you press and the default position, but once you release it will always be on the default position. And you can just hide the cursor, so the user won't see it flickering. But this requires that there is such a command in processing???
I confirm that mouse-activity sucks in Processing with win8.
The problem come from how Processing handle it - I don't know how it works, but there is an issue somewhere - .
You have to handle it by yourself, without using the property "mousePressed" , never. The method "mousePressed" looks to work as expected but the property is not stable enough. You should create a local variable/method "mouseIsPressed" in your classes and modify it from the main "mousePressed" method
tlecoz could you try to elaborate a bit on that? My biggest problem by far is that the cursor hovers over the last pressed button and if another button is pressed, it will first press the previous button before pressing the selected button. So frustrating. How would one write a function that solves this problem?
Oh, I think in your case, the problem come from your code . Can you post it, then we will be able to see what's wrong in it
First of thanks for your help. Sometimes i am so consumed by getting things to work that i forget to express my gratitude over how helpful people are :)
My code are to long and uses serial to communicate with an arduino, but the problem can be recreated by using the example code from the ControlP5 library:
I do not believe that the error has anything to do with the ControlP5 library. In my sketch i have som buttons that i have drawen from scratch and does not use the controlP5 library. If i press on one with the mouse, there are no problem, but when pressing on the screen i have to swipe the screen instead of pushing to get an accepted press.
Anyway try this code and see if you get the same result as i have described at the end of the code (can be found in the ControlP5 example library "ControlP5 Button"):
Okay so try to press the ColorA button with the mouse and then the ColorB button. You will se that in the processing text prompt it changes just as expected, First it writes ColorA and then ColorB. Then do the same using the touch screen. You will see that it writes ColorA and then ColorA again, even though you pressed ColorB. A third touch on ColorB will get you the ColorB.
Hi, I am facing the exact same problem today with the touchscreen of a Raspberry Pi 3. The problem is that a first tap on the screen sets the (X,Y) position of the mouse pointer (even though it's supposed to be a touch screen and therefore the concept of a mouse pointer is subjected to discussion), while a second tap sets new (X,Y) values, but adds a click event at the former position. This explains why ColorA appears twice before ColorB displays.
The problem is awful when dealing with Knobs or Toggle buttons: by clicking away from the controller if the "mouse" (equivalently mouseX and mouseY variables) is positioned on the controller, the controller is triggered before the "mouse" is moved (equivalently before mouseX and mouseY are set to new values corresponding to the click away from the controller).
How could I fix such behavior?
Thanks!
When I used P5Control this problem occurred to me. Then, I changed to 4GP library and it accept one touch as button pressed.
Has anyone made any progress on a workaround for this issue with the ControlP5 library? I'm having the same issues with touch input on Windows that palmhoej and jellium described.