mystor / meteor-device-detection

(NO LONGER SUPPORTED) Client-Side Device Type Detection & Template Switching with Optional Meteor-Router Support
MIT License
69 stars 17 forks source link

Add Meteor.Device.isTouch() #10

Closed gb96 closed 9 years ago

gb96 commented 9 years ago

For my project, I don't care if the Device is Desktop/Laptop/TV/Phone/Tablet/Bot etc, what I really want to know is if there is a Touch interface or not. Generally you can assume Phone/Tablet have touch, but others are more difficult to tell. You could have a Desktop with Touch in which case I would like to provide the same touch UI features as I do on Phone/Tablet.

Is it possible to define isTouch based on device detection?

mystor commented 9 years ago

This library was written using a set of user agent regexes which attempt to identify whether a user is on mobile or desktop. I would recommend not using this library if the type of responsiveness you want in your app is touch/not-touch, as it can't actually tell. If you want to perform feature detection, as it seems you do, I recommend using Modernizr or similar (http://modernizr.com/).