The TouchList object of a TouchList event contains detailed information about the touch of individual points. Among the many properties, touchType is probably the most interesting for you, as it contains either a stylus (Apple Pencil) or direct (finger).
var body = document.getElementByTagName('body'); body.addEventListener('touchstart', function(evt){
You should also look at other properties of each specific Touch, for example force or azimuthAngle , which can provide you with detailed information about the current devices (points) of touch points.
Please note that the Touch interface is only part of the W3C working project , and not an official standard - however, it works in iOS 10 + Safari + Apple Pencil.
source share