Hersir Posted July 31, 2018 Share Posted July 31, 2018 Hi, noticed issue with pointer up event on onPointerObservable for some android devices, looks like sometimes pointer up is not triggered just pointerDown and pointerCancel. So `totalPointersPressed` is counting up and is not lowered. Not sure if we can fix that on babylonjs side, as my fix was to add cancel listener to window and call onPointerUp there, it works but could lead to different issues, as click is triggered without releasing finger from the screen for example. I have seen it very rarely on newer devices as well but on this android it repeats every second click. Device: Android 5.1.1, Galaxy Note 4, Stock browser (Internet) Maybe someone have some ideas what could be done there, without breaking it for rest of the devices. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 31, 2018 Share Posted July 31, 2018 Android is such a mess... I don;t know how to help here as the code is correct and works everywhere else Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 1, 2018 Share Posted August 1, 2018 Can you share how you are handling pointer events? ie: using <canvas... touch-action="none"/> and jquery PEP If it's really a browser quirk, if we can assume that two pointer down events shouldn't occur, without a pointerUp occuring inbetween then we can maybe write a hacky fix. Check out this PR I did ages ago on PointerUp for GUI button - this was occurring if, for example, you moused off the canvas (pointerUp off canvas) and then did another pointer-down, so not android specific the pointer up was being missed by BabylonJS. That kind of solution would work for you here as well, in some cases. Anyway, may give you some ideas or attach to document.body for Android? https://github.com/BabylonJS/Babylon.js/pull/2210/files Depends on what you are trying to accomplish. I think if you end up triggering/simulating a pointerUp event just before 2nd down (w/o an up) then you need to choose if that happens where the last down was or where the new down was - as you will statefully need to remember. That's really the only idea that I have... like your own polyfill Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2018 Author Share Posted August 1, 2018 @brianzinn Hey, yes I use ` <canvas... touch-action="none"/> and jquery PEP` for pointer events, but pointer up is registered in window in babylonjs engine not sure if that can impact PEP. Then use observable from engine to listen to pointer events. Technically you can have 2 down events as you can press 2 fingers on the device, but each down event should trigger up. But really can nit find why android is canceling these events. Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2018 Author Share Posted August 1, 2018 Ok looks like it desired behaviour of the android if `e.preventDefault` is not used int he touchmove event Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2018 Author Share Posted August 1, 2018 But looks like PEP is doing it already, so could be some issues on their side as well, will try to debug PEP a bit Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 1, 2018 Share Posted August 1, 2018 Samsung modify their (Chrome) Browser. I bet when you download Chrome from App Store it would work properly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.