The editor only used the pen-aware PointerEventHandler on iOS, or on Android
when platform.isMobile was true. That flag comes from a "Mobi" token in the user
agent, which Android tablets usually leave out, so on a tablet the editor fell
back to TouchHandler and a stylus could only scroll, not select.
Widen the check to any Android device when Pointer Events are available, the
same as iOS already does. The iOS branch is unchanged.
What this does
A stylus or pen drag now selects text in the editor on Android, the same as it
already does on iOS. A finger drag still scrolls, and the mouse is unchanged.
Why
The editor only sends pointer input through PointerEventHandler, the handler
that lets a pen select while touch scrolls, on iOS or on Android when
platform.isMobile is true. platform.isMobile looks for a "Mobi" token in the
user agent, and Android tablets usually leave that token out. So on a tablet the
editor fell back to TouchHandler, and a stylus could only scroll, never select.
Android phones were unaffected because their user agent carries "Mobi".
Background: microsoft/vscode#198578 added the pen/stylus selection path for
mobile; this extends it to Android tablets.
The change
One line, in a new patch (patches/pen-support.diff):
The iOS branch is left as is. The only difference is that Android no longer
requires the isMobile flag to reach PointerEventHandler.
Testing
Built and run on a Samsung tablet with an S Pen, in Chrome:
Also reproducible in desktop Chrome with DevTools device mode set to an Android
tablet user agent that has no "Mobi" token.
Notes
iPad and iPhone are unaffected; the iOS branch is untouched. Android phones are
unaffected too, since they already satisfied isMobile.