New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add warning about browser support for touches[] array #1672

Closed
JGL opened this Issue Nov 22, 2016 · 9 comments

Comments

Projects
None yet
6 participants
@JGL

JGL commented Nov 22, 2016

I've just made a basic demo to try experimenting with multitouch within p5.js:

https://jgl.github.io/Reactickles3/TouchDemonstration/

You can find the source code below:

https://github.com/JGL/Reactickles3/blob/master/docs/TouchDemonstration/sketch.js

I'm drawing a circle on every touch, but only one ever gets picked up. What am I doing wrong?

@hkirat

This comment has been minimized.

Show comment
Hide comment
@hkirat

hkirat Nov 23, 2016

Contributor

Works fine for me.
Browser : Firefox
Android Device

Contributor

hkirat commented Nov 23, 2016

Works fine for me.
Browser : Firefox
Android Device

@limzykenneth

This comment has been minimized.

Show comment
Hide comment
@limzykenneth

limzykenneth Nov 24, 2016

Contributor

Looking at MDN it seems to be only supported on Firefox and Chrome only

Contributor

limzykenneth commented Nov 24, 2016

Looking at MDN it seems to be only supported on Firefox and Chrome only

@lmccart

This comment has been minimized.

Show comment
Hide comment
@lmccart

lmccart Nov 24, 2016

Member

aha interesting. we should add a note to the documentation.

Member

lmccart commented Nov 24, 2016

aha interesting. we should add a note to the documentation.

@limzykenneth

This comment has been minimized.

Show comment
Hide comment
@limzykenneth

limzykenneth Nov 24, 2016

Contributor

Although it's not consistent nor recommended, you can try user agent sniffing.

var ua = navigator.userAgent;
var safariReg = /^((?!chrome|android).)*safari/i;

if(safariReg.test(ua)){
  // browser is safari
}

Because Chrome's user agent string have "Safari" as well so need to check to make sure it's not Chrome. The regex should checkout though better test it to be sure.

Contributor

limzykenneth commented Nov 24, 2016

Although it's not consistent nor recommended, you can try user agent sniffing.

var ua = navigator.userAgent;
var safariReg = /^((?!chrome|android).)*safari/i;

if(safariReg.test(ua)){
  // browser is safari
}

Because Chrome's user agent string have "Safari" as well so need to check to make sure it's not Chrome. The regex should checkout though better test it to be sure.

@lmccart lmccart changed the title from touches[] array not picking up more than one touch to add warning about browser support for touches[] array Jan 9, 2017

@lmccart lmccart added area:mobile and removed area:mobile labels Mar 15, 2017

@mlarghydracept

This comment has been minimized.

Show comment
Hide comment
@mlarghydracept

mlarghydracept Apr 19, 2017

Contributor

The touches[] array is supported by Safari on mobile according to MDN. It only isn't supported on Safari and IE on touch-based desktops (laptops).

Contributor

mlarghydracept commented Apr 19, 2017

The touches[] array is supported by Safari on mobile according to MDN. It only isn't supported on Safari and IE on touch-based desktops (laptops).

@mlarghydracept

This comment has been minimized.

Show comment
Hide comment
@mlarghydracept

mlarghydracept Apr 19, 2017

Contributor

@almchung any interest?

Contributor

mlarghydracept commented Apr 19, 2017

@almchung any interest?

@almchung

This comment has been minimized.

Show comment
Hide comment
@almchung

almchung Apr 19, 2017

Contributor

I'll add this to the next version of our error messaging system. I'll also update the documentation, like Lauren said.

Thanks!

Contributor

almchung commented Apr 19, 2017

I'll add this to the next version of our error messaging system. I'll also update the documentation, like Lauren said.

Thanks!

@lmccart

This comment has been minimized.

Show comment
Hide comment
@lmccart

lmccart Apr 23, 2017

Member

fixed with #1905

Member

lmccart commented Apr 23, 2017

fixed with #1905

@lmccart lmccart closed this Apr 23, 2017

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