Distinguish between onButtonUp events in BaseCameraPointersInput

Hello all, I’m seeing some variation in the data populated in the IPointerEvent when receiving an event in the onButtonUp handler in BaseCameraPointersInput while using a mobile device.

It seems like the source for the touch events is in the webDevicesInputSystem. I’m would like to know if there’s a way to distinguish between events generated from the sources: _pointerBlurEvent, _pointerCancelEvent, and _pointerUpEvent?

I’m using the pointerId in the up and down handlers to tie corresponding events together. I’m running into issues in the case of blur and cancel events, where the deviceSlot is being populated to the pointerId field instead.

cc @PolygonalSun

I’m not sure if there’s a specific way tell the difference between all three of those events but the _pointerCancelEvent and _pointerBlurEvent functions will return an event generated from DeviceEventFactory.CreateDeviceEvent() and because of this, those specific events only have the properties used by BJS. While you could create a filter to check for one of these missing properties (detail maybe?), I think the bigger issue at hand is that those events are returning an incorrect pointerId. Lemme take a look and what’s going on. If it’s what I think it is, it should be an easy fix.

1 Like

I found the issue and I have a PR out to fix it: DeviceInputSystem: Use correct pointerId for touch inputs on blur and pointercancel event by PolygonalSun · Pull Request #13516 · BabylonJS/Babylon.js (github.com). I’ll update this thread when it’s merged or if anything comes up.


PR is merged

1 Like