Skip to content

Support mice properly #757

Closed
Closed

Description

@Hixie

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.)

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Dec 5, 2015
  2. added this to the milestone on Dec 5, 2015
  3. modified the milestones: , on Sep 14, 2016
  4. goderbauer commented on Dec 27, 2018

    @goderbauer
    Member

    @gspencergoog Is this something you're working on?

  5. gspencergoog commented on Jan 7, 2019

    @gspencergoog
    Contributor

    Not yet, but I'll probably end up touching on this while working on mouse support.

  6. mdebbar commented on May 17, 2019

    @mdebbar
    Contributor

    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 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?

    cc @gspencergoog @Hixie

  7. stuartmorgan-g commented on Jul 26, 2019

    @stuartmorgan-g
    Contributor

    Is there any work left here after the recent changes?

  8. gspencergoog commented on Aug 7, 2019

    @gspencergoog
    Contributor

    We think this is done.

  9. github-actions commented on Aug 28, 2021

    @github-actions

    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.

  10. locked as resolved and limited conversation to collaborators on Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktopc: contributor-productivityTeam-specific productivity, code health, technical debt.c: new featureNothing broken; request for a new capabilitycustomer: fuchsiaframeworkflutter/packages/flutter repository. See also f: labels.platform-fuchsiaFuchsia code specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions