RE: IE implementation of navigator.maxTouchPoints

They see the IsTouchDevicePresent() logic as redundant (other than it just so happens the Win7 bug makes it return false in the one trackpad case).  As spec’d/documented, there shouldn’t be a need for the IsTouchDevicePresent() code. So it’s really a choice of whether you want to have your implementation exploit the bug or not (they’re not likely to fix that bug though).
From: [] On Behalf Of Rick Byers
Sent: Wednesday, September 17, 2014 3:54 PM
To: Jacob Rossi
Cc: Sangwhan Moon; Sangwhan Moon;; David Bokan
Subject: Re: IE implementation of navigator.maxTouchPoints

Thanks Jacob.  What we ended up landing<> is slightly more involved than that - re-uses our existing touchscreen detection logic:

bool IsTouchDevicePresent() {

  int value = GetSystemMetrics(SM_DIGITIZER);

  return (value & NID_READY) &&

      ((value & NID_INTEGRATED_TOUCH) || (value & NID_EXTERNAL_TOUCH));

int MaxTouchPoints() {

  if (!IsTouchDevicePresent())

    return 0;

  return GetSystemMetrics(SM_MAXIMUMTOUCHES);


Does your Windows input team see any problem with relying on this?  We have been using this IsTouchDevicePresent code for awhile (took some feedback from users to get it here), so using it also in MaxTouchPoints seems very reasonable and low risk to us...


On Fri, Sep 12, 2014 at 5:38 PM, Jacob Rossi <<>> wrote:
Upon further discussion with the Windows input team, it looks like it's actually a Win7 bug that SM_DIGITIZER is false in these cases and that it's definitely not the case that this represents the difference between a touchscreen and a touchpad.  They advised against this using this pattern.

Unfortunately, there is not a way to differentiate rogue touchpad drivers from touchscreen.  In Windows 8+, we're encouraging touchpad manufacturers to use Precision Touchpad, which enables the same scenarios without virtual touch drivers.


-----Original Message-----
From: Jacob Rossi [<>]
Sent: Friday, September 12, 2014 10:49 AM
To: Sangwhan Moon; Rick Byers
Cc: Sangwhan Moon;<>; David Bokan
Subject: RE: IE implementation of navigator.maxTouchPoints

On Wed, Sep 10, 2014 at 6:46 PM, Rick Byers <<>> wrote:
> Thank you!  Indeed it looks like this is Windows 7 only, and unlike IE we do still want to support touchscreens on Windows 7 (a small but non-trivial fraction of our touchscreen users are still on Windows 7).  It looks like SM_DIGITIZER is false in these cases, so I think we can try looking at SM_MAXIMUMTOUCHES only when SM_DIGITIZER is true. Sound reasonable to you?

I'm not an expert with these APIs. I have a mail thread with the Windows team that builds these APIs asking for advice and any implications of the design you suggested. I'll let you know what I find out.


Received on Monday, 22 September 2014 05:38:50 UTC