Anoop
Anoop

Reputation: 23208

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?

Upvotes: 6

Views: 2699

Answers (1)

NakedBrunch
NakedBrunch

Reputation: 49413

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
}

Upvotes: 8

Related Questions