Purpose of ScreenSpaceEventHandler._seenAnyTouchEvents

Hello there!

I'm digging through the touch support code in Cesium since the company I'm working for is using Cesium in an environment heavily relying on touch devices.

I was wondering what was the reason behind the ScreenSpaceEventHandler._seenAnyTouchEvents variable: it seems to completely disable mouse input whenever a touch is detected. Why is this needed?


Hi Alessio,

This was added because many devices send “simulated” mouse events even if you preventDefault the touch events. However, with the proliferation of dual-input devices, such as notebooks with both a mouse and a touch screen, this code has become less desirable, it completely breaks the mouse on such machines.

I think the correct answer is to ignore any mouse events that arrive within some fraction of a second of touch events. Should be relatively straightforward to implement, but it’s not high priority for us at the moment.

I know I asked this before, but is there any way to convince your company to allow you to sign the CLA? The logic is pretty simple, your company gets all of Cesium for free, but it needs a little bit of fixing up for your particular use case. If you make those fixes and you don’t share them with us, then your company is stuck with the burden of maintaining its own custom fork of Cesium, and updating your custom fork to keep it alive as Cesium evolves. If you sign the CLA and send the fixes back to us, you free yourselves from that maintenance responsibility, passing the technical debt back to the core Cesium team for future maintenance. In the long run, this saves your company money, in the form of fork maintenance time spent by employees.