Knowing how many fingers are down on iOS

As far as I can tell, there’s no way of knowing when running under iOS whether an incoming mouse down is coming from a single finger or if more fingers are on the display other than setting a timer and waiting a few milliseconds to see if any further events arrived. From the MouseEvent you can get its MouseInputSource and from the input source you can get its index in the global list of sources, but there’s no method to give you the total number of sources. Desktop has a method getNumMouseSources() but this also doesn’t give an accurate count until the last event has been processed. These events are coming in as a set of events on both iOS and Windows. So there’s really no reason why the total event count couldn’t be made available to each MouseEvent, and actually, when the first MouseEvent comes in you ideally would be able to get all of the events in the set through the first MouseEvent so that you can just process a set of events when the first event arrives.

Interesting point. I’m just starting to work on some more gesture recognition work, so will probably be addressing this soon.