Touch with Mouse but auto disabled for tablets

0 favourites
  • 2 posts
From the Asset Store
Auto-Chess Arena
$1.50 USD
90% off
game inspired by auto chess , with soulslike combat
  • 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 = (this.properties[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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)