MagicTouch
MagicTouch copied to clipboard
Fixed a bug where some touch events still performed the default actions.
Fixed a bug where some touch events still performed the default actions. Also, added code to remove the last touch-point visualization after the touchend event.
Thanks but I don't think your touchend modification is right. You can't clear the list of touches every time there's a touchend because there may be other fingers on the screen... I'm seeing a flickering effect.
I see what you are saying. You are correct. It is interesting that I did not see the flickering myself. Perhaps, change the line in the touchend listener: -touches = []; +touches = event.touches;
The most important change I made was to add: event.preventDefault(); on all the listeners. The code did not work otherwise.
I should also mention that I am testing this on an actual touchscreen with the MagicTouch script.
The point of MagicTouch is to simulate a touch screen when you don't have access to one, though. Not sure that your use case is a valid one, unless I'm misunderstanding something.