I have a HTML5 compass that works quite ok. Now I need a smart way to distinguish between "pseudo deviceorientation enabled" browsers (as desktop chrome and FF) and real candidates like iPhone/Android/iPad Browsers that use the device's magnetometor.
My current solution is a basic check for the DeviceOrientationEvent and touch support:
if (window.DeviceOrientationEvent && 'ontouchstart' in window) {
// setup real compass thing, with event.alpha
} else {
// setup some mouse following hack
}
Is that enough? I'm not really sure about devices "with touch support but no magnetometer", as for example chrome on a mac book has touch support, and a fake deviceorientation?