Jump to content

Multi-touch issue on Android browser


remvst
 Share

Recommended Posts

Hey guys,

 

I just wanted to share a quick workaround about multi-touch issues on the default Android browser.

 

You may have noticed that the browser's behaviour is really weird when dealing with multiple touches. I had the problem with this ugly game :

 

269e46f590267c96dcd8251704471.png

 

As you can see, the player controls the astonaut with two "virtual" keys displayed on the canvas. Therefore, he must be able to press one key or the other, or both at the same time.

 

Anyway, I found a workaround by thinking about Biolab Disaster. The issue occurs only when using the same DOM element to identify user touches, so the idea is simple to use several elements instead.

 

In my case, I just put two empty <div> elements on the left and on the right of the screen, just over the canvas, and then I just have to listen to single touches on each element and it works fine.

 

Though, the virtual keys are still displayed via the canvas, to avoid any display issues with layered elements.

 

I'm not sure if this has already been discussed, but I think it won't hurt to share :)

 

Hope it will be useful :)

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...