'Javascript touch event: distinguishing finger vs. Apple Pencil
In Mobile Safari, is there any way to distinguish whether a touch event is generated by finger or Apple Pencil?
Solution 1:[1]
You can check the touch force with:
e.touches[0].force;
But it works also for 3DTouch on iPhone 6s.
Only Apple Pencil events and touches events on iPhone 6s have .force
EDIT:
Nowdays there is touchType on iOs Safari:
e.touches[0].touchType === 'direct' // this is a finger
e.touches[0].touchType === 'stylus' // this is an Apple Pencil
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
