Sign in to follow this  
gamify

click and double click

Recommended Posts

Yes, it is possible.

I assume your real question is how to implement double-click? You've probably noticed that melonJS only supports the PointerEvent spec, which itself does not specify gestures like double-click, pinch, or swipe.

You can build your own by introducing a delay in the pointerup handler; set a timeout, then wait for one of the following events to occur:

  • If a pointerdown event is received while waiting, this event needs to be promoted to a double-click event and triggered immediately.
  • If the timeout expires first, trigger a single-click event immediately.

The delay is configurable by the host operating system, it is usually about 300ms. We don't have any way of querying the UA to get any information about gesture settings.

That said, I found the same question asked on the Babylon forum: 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.