Hi everyone,
I am having some problem with touchEnded()
function.
I am using it to switch from a case to another and it works fine with the mouse on laptop.
However, if I use a tablet it seems that the touch lasts longer as there was a lag between the touch and the end of the touch. Or it’s like the touch happened twice.
For example if I click in (xpos, ypos) and I am in case1, when it switches on case2 the touch is still active in the same position and it messes up with the things happening in the second case.
I am trying to understand what could be wrong but I can’t. The mouse click works well, the touch doesn’t.
here is a short version of the code. I have already tried to avoid the first conditional (mouseButton===LEFT)
but the problems is still there.
Any idea anyone on what may be going on?
Thanks!
if(mouseButton === LEFT){
switch(pages){
case 'one':
//code here
pages = 'two';
break;
case 'two':
//code here
pages = 'three';
break;
}
}