Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Add touchType, altitudeAngle, azimuthAngle (Safari iOS 10.3 extensions for stylus) #81

Merged
merged 3 commits into from
Apr 21, 2017

Conversation

RByers
Copy link
Contributor

@RByers RByers commented Apr 21, 2017

Apparently Safari on iOS 10.3 now exposes the stylus properties from iOS. These seem reasonable to me (map closely to PointerEvents tiltX, tiltY and pointerType) and could help enable more complete Pointer Events polyfills. I think we should add them to the spec to document what an important implementation has shipped.

See here for the output.

@grorg does this look good and match what you've shipped in Safari?

@grorg
Copy link

grorg commented Apr 21, 2017

This matches what we shipped in iOS 10.3.

@RByers
Copy link
Contributor Author

RByers commented Apr 21, 2017

Thanks. @patrickhlauke WDYT?

@patrickhlauke
Copy link
Member

Fundamentally not opposed to adding these of course (modulo my grumbles around not going full pointer events, but I understand the non-tech-related blockers for this). Will just double-check that ReSpec is happy with the way these additions are formatted and then happy to merge.

@patrickhlauke
Copy link
Member

Ah, I see ReSpec hasn't been happy with the WebIDL formatting in this spec for a while anyway...will fix this separately. In meantime, happy to merge. Thanks for documenting @RByers and @GROG for confirming accuracy.

@patrickhlauke patrickhlauke merged commit 0d0ab17 into w3c:gh-pages Apr 21, 2017
@patrickhlauke patrickhlauke changed the title Add Safari iOS 10.3 extensions for stylus Add touchType, altitudeAngle, azimuthAngle (Safari iOS 10.3 extensions for stylus) Apr 21, 2017
@patrickhlauke patrickhlauke removed their request for review April 21, 2017 10:58
@patrickhlauke patrickhlauke added this to the TouchEvents v2 milestone Apr 21, 2017
@patrickhlauke
Copy link
Member

@grorg @RByers related to this...i'm having a hard time actually visualising what azimuthAngle actually is/represents. i don't suppose there's any neat diagram somewhere along the lines of the tiltX/tiltY illustrations in PE https://w3c.github.io/pointerevents/#dom-pointerevent-tiltx that could provide some visual clarity?

@patrickhlauke
Copy link
Member

ah, on re-reading it a few times (and referring to the language in https://developer.apple.com/reference/uikit/uitouch/1618131-azimuthangle) i think i'm getting it now. am i right in assuming that the Apple Pencil has no concept of "twist" (i.e. that both the altitudeAngle and azimuthAngle remain unchanged if i simply spin the Pencil along its lengthwise/z axis while keeping its overall position/attitude towards the digitizer surface the same)?

patrickhlauke added a commit to patrickhlauke/touch that referenced this pull request Apr 24, 2017
@patrickhlauke
Copy link
Member

FWIW updated https://patrickhlauke.github.io/touch/tracker/multi-touch-tracker-pointer-hud.html to now list the new values in the tracker. hoping to also update the WebGL tracker for pointer events stylus properties to support these, but that will likely take some time... https://patrickhlauke.github.io/touch/pen-tracker/

@RByers
Copy link
Contributor Author

RByers commented May 1, 2017

am i right in assuming that the Apple Pencil has no concept of "twist" (i.e. that both the altitudeAngle and azimuthAngle remain unchanged if i simply spin the Pencil along its lengthwise/z axis while keeping its overall position/attitude towards the digitizer surface the same)?

Sorry for the delay. Yes, AFAIK there's no notion of twist (I think that's the same as MS Surface, right?). But Twist is entirely separate I think (unless you're thinking about the special case of the stylus pointing straight up and down).

altitudeAngle/azimuthAngle are mathematically just an alternate representation of tiltX/tiltY. Android has basically the same thing with AXIS_TILT (altitudeAngle) and AXIS_ORIENTATION (for stylus only, equivalent of azimuthAngle). In Chrome we just do some trigonometry to convert between the one representation and the other.

@patrickhlauke
Copy link
Member

(I think that's the same as MS Surface, right?).

correct.

@patrickhlauke
Copy link
Member

@grorg quick question: are these new properties officially documented anywhere (for JS/touch event side, rather than native) on developer.apple.com yet?

patrickhlauke added a commit to patrickhlauke/getting-touchy-presentation that referenced this pull request May 8, 2017
patrickhlauke added a commit to patrickhlauke/getting-touchy-presentation that referenced this pull request May 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants