I found out where the problem is coming from and I fixed it.
It took me time to answer because I wanted to be sure that this is not my code having problems.
It actually comes from JUCE.
I explain :
I have the latest version (did a clone yesterday)
eventCancelled is caught indeed, the problem is not coming from here.
When 4 simultaneous touches are performed and the ‘4 fingered swipe’ is triggered by the IPad, 4 touchesCancel are sent (for each finger). (this works fine)
The problem is just afterwards, in the method “UIViewComponentPeer::handleTouches” (juce_ios_UIVIewComponentPeer.mm) when JUCE calls “currentTouches.getIndexOfTouch()” [line780]
The returned touch indexes were always [0, 0, 0 ,0] or something like [2, 0, 0, 0] instead of returning for exemple [1, 0, 2, 3]
And this is because of all the indexes weren’t returned that I was receiving only half of the MouseUP events.
when currentTouches.getIndexOfTouch() is called and returns an index, it remembers which index it has been returned by saving it in an Array. I figured out that this Array is always empty at the next call of currentTouches.getIndexOfTouch().
This is simply because the array is cleared each time a touch is processed when in cancel, so currentTouches.getIndexOfTouch() always return the same value as it’s the first time it is called.
to resolve the problem this (code below) had to be replaced in “UIViewComponentPeer::handleTouches” (juce_ios_UIVIewComponentPeer.mm) (line 811):
++ currentTouches.clearTouch (touchIndex);
modsToSend = currentModifiers = currentModifiers.withoutMouseButtons();
So now, all mouseUP are triggered.
Am I clear enough ?