Jump to content

PointerCancel event on android devices


Hersir
 Share

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.

 

Link to comment
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 :)

Link to comment
Share on other sites

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...