someElement.addEventListener(
"touchstart",
(event) => {
for (const touch of event.changedTouches) {
// Log the altitude and azimuth angles for each stylus touch point.
if (touch.touchType === "stylus") {
console.log(`altitudeAngle: ${touch.altitudeAngle}`);
console.log(`azimuthAngle: ${touch.azimuthAngle}`);
}
}
},
false,
);Touch: altitudeAngle property / notebook
Touch: altitudeAngle property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.