Skip to content

web: an Apple Pencil counts as touch; treat a stylus as a pen #568

Closed

Description

@foxnne

Follow-up from #563, the pointer seam (dvui.pointerKind()).

On the native backend, SDL's pen and mouse touch ids are excluded, so a pen reads as .mouse. On the web, web.js turns every TouchEvent into a dvui touch button. An Apple Pencil on iPad Safari sends TouchEvents with touch.touchType === "stylus", so a pencil counts as .touch there. That's consistent, not flipping, but pixi users drawing with a pencil on the web get touch behaviour: no hover after a lift, and touch-style panning in canvases.

Fix in web.js (dvui's web glue, pinned from dvui-dev):

  • Route touchType === "stylus" touches as mouse/pen input rather than touch buttons.
  • Or move to Pointer Events and use pointerType ("pen" / "touch" / "mouse"), which also covers Android styluses.

That would make a separate PR, with a dvui-dev commit and a repin.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions