Skip to content

Conversation

@stretchtiberius
Copy link

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.

…ns. Also, added code to remove the last touch-point visualization after the touchend event.
@borismus
Copy link
Owner

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this line to:
touches = event.touches;

@stretchtiberius
Copy link
Author

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.

@borismus
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants