We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey,
I use in my programm touchEnded(), touchMoved() and touchStarted(), but touchEnded() makes problems. I tried to make a easier code example, but its the same. :/ I get this error (TypeError: evt is undefined) in this simple example:
function touchMoved() {
console.log("moved");
return false;
}
function touchStarted() {
console.log("started");
return false;
}
function touchEnded() {
console.log("ended");
return false;
}
If I touch and release directly, than I get all the console log entries. But if I moved while touching and stop it, then I never get the console log with "ended". Why?
Thank you! Eispfote
Answers
https://forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
http://CodePen.io/GoSubRoutine/pen/egvPwb/right/?editors=1011
"index.html":
"sketch.js":
Thanks for your answer. No error, but its the same problem. When I use touch and pressed the finger on the display while moving and release --> nothing happens Only if I tapped on the display I get "ended"?
You're right! Visiting http://CodePen.io/GoSubRoutine/pen/egvPwb/right/?editors=1011, I've only used a regular mouse. Now after checking it out w/ a laptop's touchpad, I've got the buggy behavior you've described. Nothing when I drag my finger. And a simple tap click only gets me start & end, but no move at all. :|
However, I've found out a workaround. Rather than tap once, double tap it and hold it down. Then we can drag our finger *-:)
Another online example to test it better. Although it's using mouseDragged() instead of touchMoved() for the original example. But it doesn't seem to make any difference in my laptop: @-)
http://CodePen.io/jacorre/pen/woyNXG/right/?editors=001
http://CodePen.io/anon/pen/bBQOKV/right/?editors=0011
I guess you should contact the devs about how to allow touch dragging w/o needing to double-tap it 1st. Some past touch related issues below: :-\"
https://GitHub.com/processing/p5.js/issues?utf8=✓&q=is:issue touch
https://GitHub.com/processing/p5.js/issues/1775
https://CodePen.io/Eispfote/pen/YNQyWX/right/?editors=0011