Touch with Mouse but auto disabled for tablets

Bugs will be moved here once resolved.

Post » Wed May 22, 2013 6:18 pm

Hey, I know it's mentioned that we shouldn't tweak Official plugin but I think the fix I've done should be standard, currently i have to use it otherwise it brakes my interaction on android tablet and I want just one deploy-able build.

The fix just detects the browser using user-agent and disable mouse input if isMobile or isTablet.

All I've done is add the section of code below :

this.useMouseInput = ([0] !== 0);

          var ismobile = (/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(navigator.userAgent.toLowerCase()));
          var istablet = (/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase()));
          if ( ismobile || istablet ) { this.useMouseInput = 0 }


*the bug i was getting was double events for touches on the tablet.
Posts: 140
Reputation: 5,004

Post » Thu May 23, 2013 3:31 pm

Hmm... you could just turn off 'use mouse input', but then I guess that's inconvenient for desktop. I've made it turn that option off on mobile in the next build (using the runtime isMobile property since that better detects mobile platforms).

Edit: actually, this might not work since you can actually add mouse devices to Android or other touch-screen systems, and the mouse will be broken if you use this code. So it doesn't fix it, it only breaks it under different circumstances.

We try to prevent the default behavior on all touches, which ought to prevent Android firing a mouse event afterwards, so I think this is actually an Android bug. Which version of Android and which browser are you testing on? It shouldn't happen with Chrome for Android.Ashley2013-05-23 15:34:56
Scirra Founder
Posts: 22,821
Reputation: 176,106

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests