-
Notifications
You must be signed in to change notification settings - Fork 24
Add touchType, altitudeAngle, azimuthAngle (Safari iOS 10.3 extensions for stylus) #81
Conversation
This matches what we shipped in iOS 10.3. |
Thanks. @patrickhlauke WDYT? |
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. |
@grorg @RByers related to this...i'm having a hard time actually visualising what |
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 |
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/ |
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. |
correct. |
@grorg quick question: are these new properties officially documented anywhere (for JS/touch event side, rather than native) on developer.apple.com yet? |
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?