New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map mouse input to new / moved touches instead of only first #3688
Conversation
secondary touches should not trigger clicks, so that sounds correct? |
Is there a reason for them not to do so? I find it kinda incorrect they don't trigger clicks, holding a touch and then tapping with another touch. To expand a bit on this, multi-touch events are mostly meant to be handled for when you want to receive more than one touch and start performing certain actions on them (pinch, rotate, etc...). Either way I actually forgot to mention that also with the false-drag issue, secondary touches won't even raise |
I don't think it is weird that secondary touches don't click. Just from a super quick test on Android, if you start a first touch and then hold it, the second touch doesn't cause clicks. Overall it seems fine to me that the first touch "takes ownership of being the mouse". It's just the false drags upon touch transfer that are undesirable. |
We already had that discussion, if we're testing to that, then in iOS second touches do cause clicks (hold one finger in empty area and tap an app in another finger). And from what I'm seeing, currently it seems that checking against |
I remember the order discussion but it appears I misunderstood what you meant by "clicking not working at all with secondary touches". |
ios does not trigger "clicks" / primary action on subsequent touches. it causes positional updates. not clicks. it should not cause clicks. |
OK but still as I said:
If |
Why would it though? I'm not sure where the problem is. Secondary inputs should be secondary inputs and not perform primary actions, which in our case is equivalent to being translated to a mouse event (if the drawable doesn't do manual touch handling). I thought the goal of this change was to go from the android-y way of "primary touch is first" to the iOS-y way of "primary touch is last". I really fail to see what the issue is. I think if you gave a real example of why you think secondary touches should fire mouse events, we could come to an understanding. |
Yeah figured that would be the case. The current mouse-from-touch behaviour in
|
Reading the essay above changes nothing. A second touch should not trigger a mousedown, if the "mouse" is already down. The point of this change is to make the second touch continue positional tracking, rather than being completely ignored. |
I fail to see a reason why tapping with a second touch wouldn't raise mouse downs to the drawable they're tapping, but continue positional tracking, and where would that behaviour be useful for? |
The goal is to match existing behaviours. Please try using a mobile device and notice that on no device does tapping a second finger (in a scenario where multitouch is not specifically supported) ever trigger a "mouse down" event. This is not only what users are used to, it makes logical sense. This is how we want it implemented, without question. |
OK yeah the only problem I was having here is where to actually test this, but if that's how you want it then sure wouldn't mind that. So if secondary touches are not meant to raise mouse down events to what they're tapping, but we still want them to continue positional tracking, would it be fine to just release mouse left when a secondary touch has began to fix the false-dragging issue and call it a day? |
You can test at a home screen, settings, anywhere. It should not be released, no. Leave the delta in place for now and it can be re-addressed in a future PR if deemed necessary. |
@peppy I'm actually quite concerned about how the behaviour should go, when holding a touch on a drawable and drag a bit, then pressing another touch, would the dragged drawable receive an |
as long as a finger is down, no up or end events. |
Because that would mean nullifying the delta is kinda impossible / not making sense with the events raised as-is, but I'm just gonna remove the commented assertions for now. |
See comment before. Leaving delta is the proposed path forward for this PR. |
What you have right now isn't too bad, but let's go with the following (iOS standard) for now:
|
So basically let mouse follow any touch position change, would it be fine for mouse to also move to the position of any released touch? talking for simplicity matter. (as the user would most likely nudge before releasing) |
No, only move (and release of last touch). If anything, a release should make the position update to any remaining touch, but doing nothing until movement is also fine. |
Behaviour looks correct now 👍 |
As discussed and considered, mapping mouse input to any new / moved touches instead of first touch is more better as a good starting point.
Huge note though is that now with this new logic, there will be "false drags" raised when still holding a touch and pressing a new one (mouse moves from one to other while left still pressed, thus a false drag raised), discussed about that with the result of opening an issue post-merge as it doesn't seem easy to resolve.