Touch events supported in Chrome?

816 views
Skip to first unread message

Remy Sharp

unread,
Mar 28, 2010, 12:19:21 PM3/28/10
to Chromium HTML5
I was playing around with a game I've been hacking, and I'm trying to support both mobile and desktop browsers, one thing I do is to detect touch event support - and if it's available, I use touch events instead of click (i.e. mobile).

However... Chrome on the latest dev channel is returning true for touch event support (I've not checked the other versions of Chrome).

Demo: http://jsbin.com/utuyi3/2
Source: http://jsbin.com/utuyi3/2/edit

Is this a bug or is Chrome expecting to /actually/ support touch events? That said, surely it should be device dependant (I've tested to see if this is an issue in Webkit, and it correctly reports false to touch events - so I assume this is a bug in Chrome?)

Ideas / is this a bug?

Cheers,

Remy Sharp
Left Logic

Nico Weber

unread,
Mar 28, 2010, 1:00:45 PM3/28/10
to Remy Sharp, Chromium HTML5
http://crbug.com/36415 (found by searching for "touch events" on crbug.com).

If the events don't work but chrome claims they do, that's bad. Maybe
you can mention that on the bug.

> --
> You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
> To post to this group, send email to chromiu...@chromium.org.
> To unsubscribe from this group, send email to chromium-html...@chromium.org.
> For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.
>
>

Scott

unread,
Mar 29, 2010, 2:04:27 AM3/29/10
to Chromium HTML5
Hopefully there's a command-line switch to disable these non-
functioning touchevents (like Remy, I too have an app that uses
touchevent detection to determine whether to touch or mouse events,
depending on whether it's mobile or desktop).

Looking on the official list of Chrome switches (http://
src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc), I
can't see anything to disable touch events. So hopefully these events
get sorted out in the next dev release.

On Mar 29, 4:00 am, Nico Weber <tha...@chromium.org> wrote:
> http://crbug.com/36415(found by searching for "touch events" on crbug.com).


>
> If the events don't work but chrome claims they do, that's bad. Maybe

> you can mention that on the bug.On Sun, Mar 28, 2010 at 9:19 AM, Remy Sharp <r...@leftlogic.com> wrote:
> > I was playing around with a game I've been hacking, and I'm trying to support both mobile and desktop browsers, one thing I do is to detect touch event support - and if it's available, I use touch events instead of click (i.e. mobile).
>
> > However... Chrome on the latest dev channel is returning true for touch event support (I've not checked the other versions of Chrome).
>
> > Demo:http://jsbin.com/utuyi3/2
> > Source:http://jsbin.com/utuyi3/2/edit
>
> > Is this a bug or is Chrome expecting to /actually/ support touch events?  That said, surely it should be device dependant (I've tested to see if this is an issue in Webkit, and it correctly reports false to touch events - so I assume this is a bug in Chrome?)
>
> > Ideas / is this a bug?
>
> > Cheers,
>
> > Remy Sharp
> > Left Logic
>
> > --
> > You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.

> > To post to this group, send email to chromium-ht...@chromium.org.
> > To unsubscribe from this group, send email to chromium-html5+unsubscr...@chromium.org.

Garret Kelly

unread,
Mar 29, 2010, 1:17:13 PM3/29/10
to Chromium HTML5, Nico Weber, Remy Sharp
On Mar 28, 1:00 pm, Nico Weber <tha...@chromium.org> wrote:
> http://crbug.com/36415(found by searching for "touch events" on crbug.com).

>
> If the events don't work but chrome claims they do, that's bad. Maybe
> you can mention that on the bug.

The events "work" in the sense that they're properly exposed to V8,
but nothing but test_shell will currently deliver them. I don't feel
that it's safe to assume that a user will be interacting with an
application exclusively via touch events just because their browser
supports touch events. There are devices currently on the market that
support both touch input and pointer-driven input (most convertible
tablet formfactors, like the s10-3t for instance), and it would be a
bad user experience if they loaded a page, detected their touch
capability and then refusing to respond to mouse events.

Garret

Reply all
Reply to author
Forward
0 new messages