Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect if a screen is touch sensitive?

I am developing an application for Windows 8 (Metro UI). I am using HTML5, JavaScript, jQuery etc for development. I want to show a different user interface if the screen does not support screen touch events.

How can I detect if screen support touch sensitive in Windows 8 using JavaScript?

like image 330
Anoop Avatar asked Sep 15 '12 11:09

Anoop


1 Answers

See here: Detecting Touch Hardware in IE 10

From the above page:

In order to test for touch in Internet Explorer 10, which will ship with the first batch of Windows 8 tablets later this year, you can call the window.navigator.msMaxTouchPoints method

if (window.navigator.msMaxTouchPoints) {
// touch device
}
else {
// non-touch device
}
like image 110
NakedBrunch Avatar answered Oct 17 '22 00:10

NakedBrunch