Mobile/Android: support text selection with a pen/stylus. #198578
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently it is not possible to use a pointing device on a mobile device to make text selections, leaving the keyboard as the only viable option.
This change enables a pen to be used for selection and this works well for Android-based mobile phones and tablets with support for a pen. As it enables text to be selected with the pen instead of simply scrolling (which you can already do with touch). I've tested the [PointerEventHandler] on a Samsung Z Fold5 android (using touch & S pen) and it works well, I don't see why it should be restricted to IOS, so I've removed the platform flag.
Before this change, pens on android would act as touch input (scrolling when moved) and although I don't have an IOS device on hand to confirm, from looking at the [PointerEventHandler], it would appear that an IOS pen can only be used to perform tap gestures.
I support efforts to make text selection possible using touch-only but in the mean time, this change should help to make VS Code usable on more mobile devices.
Helps to extend, compliment and address:
#21812
#47770
microsoft/monaco-editor#246 microsoft/monaco-editor#1504