You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we support mice by pretending they're a touch while down, with a unique touch ID for each click/drag.
We should probably move to a model more like:
touches pretend to have button 1 set.
gesture recognition pays attention to buttons.
we have a separate set of identifiers for touches/mice in general, and touches/mice while down. We use the latter to do gesture recognition. (Gesture recognition is explicitly only about "down" moves.)
The browser includes an identifier with each touch event (it tracks each finger with a separate identifier). We pass that identifier to Flutter as a pointer ID.
Mouse
Modern browsers provide support for the newer pointer events which include a pointerId with each event. So we forward that to Flutter.
Some browser though don't support pointer events, and we fallback to using touch events (if available) or mouse events. For touch events, we do what I described above. For mouse events, the browser doesn't include any kind of ID, so we use a hardcoded ID (-1 I believe) because we assume there's only one mouse and there's no need to change the ID.
The hardcoded ID for mouse events is different from what Flutter does, but it's working fine for us at the moment. Do you think we need to revisit and start using a new ID for each click/gesture?
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
goderbauer commentedon Dec 27, 2018
@gspencergoog Is this something you're working on?
gspencergoog commentedon Jan 7, 2019
Not yet, but I'll probably end up touching on this while working on mouse support.
mdebbar commentedon May 17, 2019
The way we do this for the web today is:
Touch
The browser includes an identifier with each touch event (it tracks each finger with a separate identifier). We pass that identifier to Flutter as a pointer ID.
Mouse
Modern browsers provide support for the newer pointer events which include a
pointerIdwith each event. So we forward that to Flutter.Some browser though don't support pointer events, and we fallback to using touch events (if available) or mouse events. For touch events, we do what I described above. For mouse events, the browser doesn't include any kind of ID, so we use a hardcoded ID (
-1I believe) because we assume there's only one mouse and there's no need to change the ID.The hardcoded ID for mouse events is different from what Flutter does, but it's working fine for us at the moment. Do you think we need to revisit and start using a new ID for each click/gesture?
cc @gspencergoog @Hixie
stuartmorgan-g commentedon Jul 26, 2019
Is there any work left here after the recent changes?
gspencergoog commentedon Aug 7, 2019
We think this is done.
github-actions commentedon Aug 28, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.