benny! Posted November 25, 2013 Share Posted November 25, 2013 Hi, the Device class by phaser (refer to line 339) sets the touch property to true on IE10, Windows7, because of the msPOinterEnabled property. if ('ontouchstart' in document.documentElement || window.navigator.msPointerEnabled) { this.touch = true; }This confuses me since no touch events are fired. As I can read in the msdn - our lovely friends from M$, fires pointer events instead of touch events. Besides, in my case, no pointer device is attached anyway, and only normal mouse events are triggered. So, my question is - is it correct to equalize pointer events with touch events? How do you guys handle pointer events? Thanks for any enlightenment ;-) Best,benny! Link to comment Share on other sites More sharing options...
benny! Posted November 25, 2013 Author Share Posted November 25, 2013 Add: Just read here that: Since MSPointer events automatically elevate to Mouse events if they aren't handled,.. So, if this is true - I recommend to wether divide into three categories (touch, mouse, msPointer) or handle msPointer more like the 'mouse' category instead of 'touch'. Any thoughts? Link to comment Share on other sites More sharing options...
rich Posted November 25, 2013 Share Posted November 25, 2013 I updated that line of code this morning after doing some Surface testing! Here is the current dev branch version: if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1)) { this.touch = true; }Even this isn't 100% bulletproof as I guess it's technically possible to have a single supported touch event on a screen, but hey it's the best we've got for now! The only way to be 100% sure is to check the event.pointerType value you get from the browser event. It can be "touch", "pen" or "mouse". benny! and shawnbless 2 Link to comment Share on other sites More sharing options...
benny! Posted November 25, 2013 Author Share Posted November 25, 2013 Thanks a lot Rich. Really valuable information since I do not own a Surface device by myself. I will try out your code later. Thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts