5

I'm developing a site that implements specific functionality for touch-enabled devices. I aim to target smartphones, tablets and in fact everything that uses a touchscreen as its primary input.

To achieve this I'm using Modernizr's Modernizr.touch

However, this returns true on chrome with computers that have a Wacom pen tablet installed. (Confirmed with Wacom Intuos 5). Obviously, the main input device on these computers is a keyboard and mouse, and not a touchscreen. This creates a false-positive, as I want to deliver the desktop UX for these computers and not the touch-screen UX.

Is there any way to check for "touch screen capabilities", rather than "touch capabilities"? Or any other creative method to get around this and avoid the false-positive?

OpherV
  • 6,787
  • 6
  • 36
  • 55
  • I have been looking for an answer to this for several months. Unfortunately, I don't think it's possible to detect hardware this way. – BenM Mar 13 '13 at 16:47
  • Here is a long discussion about this topic: https://github.com/Modernizr/Modernizr/issues/548 – Jason Sperske Mar 13 '13 at 16:57

1 Answers1

0

A simple user test of "Click or Tap this Box" should be able to tell you if they used a mouse or some touch device to complete the action. Since you can get the user-agent of devices, for tablets and phones its easy to assume with the two data's that they are touch capable... so you could only present the "test" if you detect a desktop user that also tested positive for a touch device (should be a smaller sample than testing everyone, which could get annoying to users). Of course I'd also somehow remember the user choice/test result so you don't have to bug them again.

SnakeDoc
  • 13,611
  • 17
  • 65
  • 97
  • 1
    I appreciate the input (no pun intended) :) I'd rather avoid asking any users for something as intrusive as "Click this button so that I may present you the proper menu". I'm looking for a way to achieve this automatically. Maintaining an active list of user agents and capabilities, then attaching that to user profiles seems like a disproportional, inelegant solution for this problem. – OpherV Mar 13 '13 at 17:03
  • Well technically there is a project called WURFL that maps User Agents to device capabilities (it's used for server-side device detection). I don't know about its awareness of touch events though (its used primarily for serving WML vs XHTML-MP) – Jason Sperske Mar 13 '13 at 17:04
  • Why the downvote? Looking at User-Agent string and deciding something is actually quite common and standard practice. This is how majority of "mobile enabled" sites determine which site to serve to a guest. Without the user specifically telling you what device they have, I think this is the next best thing. – SnakeDoc Mar 13 '13 at 19:04