Sign in to follow this  
Hersir

PointerCancel event on android devices

Recommended Posts

Hi,

have encountered such issue, I am listening on pointer events observable:

scene.onPointerObservable.add(this.onPointer);

this method listens to down, up, move events:

 function onPointer(info: PointerInfo) {
        if (info.type === PointerEventTypes.POINTERMOVE) {
            this.handleMove(info.event);
        } else if (info.type === PointerEventTypes.POINTERUP) {
            this.handleUp(info.event);
        } else if (info.type === PointerEventTypes.POINTERDOWN) {
            this.handleDown(info.event);
        }
    }

all woks well till on some android devices PointerUp is not triggered, after some investigation found out that event was canceled so PointerCancel was triggered instead of PointerUp, but after digging in the code saw that engine doesn't handle them at all.

Anyone had issues with pointer events being canceled ? maybe some solutions ? As it's not trivial to add cancel event handling as on some devices both Cancel and Up is handled at the same time.

Thank you for any info.

 

Share this post


Link to post
Share on other sites

But as engine is not listening to them my script gets stuck for ever, as its waiting for up event, for now added `pointercancel` event on app side, and just triggering onPointerUp from scene to force cancel as up, till now works well but in long term could get in some issues where valid cancel event will be executed as up :)

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.