Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional digitizer/pen attributes: twist (rotation) #25

Closed
skibulk opened this issue Oct 28, 2015 · 24 comments
Closed

Add additional digitizer/pen attributes: twist (rotation) #25

skibulk opened this issue Oct 28, 2015 · 24 comments

Comments

@skibulk
Copy link

skibulk commented Oct 28, 2015

Brush and Marker rotation is used by painters, calligraphers, and comic artists to achieve a variety of strokes. Stylus rotation is the digital equivalent, and is enabled by Wacom products, Adobe Photoshop. There are already numerous web apps which support drawing and painting. Lets extend their capabilities.

https://www.youtube.com/watch?v=2gm9lM7svaY
https://www.youtube.com/watch?v=ukXJQAY0caU

@RByers
Copy link
Contributor

RByers commented Oct 28, 2015

Thanks for the suggestion. Can you point me at the existing native APIs for determining rotation?

On Windows 8+ I see PointerPointProperties.Orientation and PointerPointProperties.Twist. It's not clear to me what the difference is between these.

If someone can point to a native demo app (on Windows or otherwise) and specific device where rotation is supported, it would probably help. I have a Surface Pro 3, and AFAIK that pen supports tilt but not rotation (but I'm not completely sure).

@patrickhlauke
Copy link
Member

Don't have a device at hand to test right now, but isn't a barrel rotation going to already result in the tiltX/tiltY changing (as I'm assuming the tilt will reference some idealised "zero position" of the pen, so rotating it will result in a different set of angles)?

@patrickhlauke
Copy link
Member

Also, Surface pen doesn't support tilt as far as I know, only pressure (and no, nothing specific about rotation either)

@RByers
Copy link
Contributor

RByers commented Oct 28, 2015

Don't have a device at hand to test right now, but isn't a barrel rotation going to already result in the tiltX/tiltY changing (as I'm assuming the tilt will reference some idealised "zero position" of the pen, so rotating it will result in a different set of angles)?

I don't think so. There's three axis of movement possible here. Eg. imagine the pen pointing straight up and down so tiltX and tiltY are fixed. Now roll the pen between your fingers - rotation changes without changing either tilt.

Also, Surface pen doesn't support tilt as far as I know, only pressure (and no, nothing specific about rotation either)

Oh sorry, I was thinking your stylus video (showing tilt) was with a Surface. What device was that again? I guess I better get one too.

@patrickhlauke
Copy link
Member

Ah yes, i can see how rotation is independent (though can interact with, when at an angle) from tiltX/tiltY. Not sure if there's a clean API for that which can be hooked into...

Regarding my demo: using a Wacom Intuos Pro (has to be Pro, as the cheaper models have limited/no tilt support)

@RByers
Copy link
Contributor

RByers commented Oct 28, 2015

On public-pointerevents, Dave Fleck (Wacom) replied:

Painter and Photoshop are examples of applications that support twist.
At this point most all platforms have “clean” API support (the exceptions being Tizen and web apps. ;-)
You can get API information and sample code at developer.wacom.com and sign up for Low Level APIs, or you can ask me for help.

@patrickhlauke
Copy link
Member

Excellent. I'd definitely be in favor of adding this to PE as well, in that case.

@skibulk
Copy link
Author

skibulk commented Oct 28, 2015

Wacom has an airbrush pen too. It has a wheel on the shaft which can be used to control strokes - like traditional airbrush flow mechanisms. It would be cool to see support for this as well. Maybe it is already handled like a normal mouse wheel, I don't know. Photoshop recognizes it as a "stylus wheel".

@dfleck
Copy link

dfleck commented Oct 28, 2015

The wheel is in the HID “Barrel Pressure” field (HID Usage 0x31) - sometimes referred to as “Tangential Pressure” (Mac OS). Painter and Photoshop use this.

Two more missing data elements are the Secondary Barrel Switch (HID Usage 0x5A) and Transducer Serial Number (HID Usage 0x5B). Both of these have application support (Painter uses the Serial Number to store settings on a per stylus basis and Photoshop useless serial numbers for cloud login).

@patrickhlauke
Copy link
Member

The wheel is in the HID “Barrel Pressure” field (HID Usage 0x31) - sometimes referred to as “Tangential Pressure” (Mac OS). Painter and Photoshop use this.

That feels slightly out-of-scope to me, edging close to the discussion in #26 about gamepad/webusb. Thoughts?

Two more missing data elements are the Secondary Barrel Switch (HID Usage 0x5A)

Would that not be exposed as part of button/buttons ?

and Transducer Serial Number (HID Usage 0x5B)

Again, that feels out-of-scope here (though perhaps, leaving it up to implementations, it "could" be used to ensure that the pointer relating a particular pen always gets the same pointerId ?

@RByers
Copy link
Contributor

RByers commented Mar 8, 2016

The wheel is in the HID “Barrel Pressure” field (HID Usage 0x31) - sometimes referred to as “Tangential Pressure” (Mac OS). Painter and Photoshop use this.

That feels slightly out-of-scope to me, edging close to the discussion in #26 about gamepad/webusb. Thoughts?

This seems different to than the 3d mice case to me in that it's really about art stylus scenarios which pointer events is trying to address. That said I'd consider it lower priority than pen rotation (since fewer stylus devices support it) so perhaps we should move discussion of this to a separate GitHub issue? That said, I'd be fine with adding a tangentialPressure field defined similarly to pressure.

and Transducer Serial Number (HID Usage 0x5B)

Again, that feels out-of-scope here (though perhaps, leaving it up to implementations, it "could" be used to ensure that the pointer relating a particular pen always gets the same pointerId ?

Yeah, we could have a separate issue for this but I expect it to be very controversial due to privacy / fingerprinting concerns. I know there are some art uses where it's valuable, but it seems niche and controversial enough that it's unlikely to be worth this group's time at the moment.

@dfleck
Copy link

dfleck commented Mar 8, 2016

On Mar 8, 2016, at 8:53 AM, Patrick H. Lauke notifications@github.com wrote:

The wheel is in the HID “Barrel Pressure” field (HID Usage 0x31) - sometimes referred to as “Tangential Pressure” (Mac OS). Painter and Photoshop use this.

That feels slightly out-of-scope to me, edging close to the discussion in #26 #26 about gamepad/webusb. Thoughts?

There’s nothing vendor specific here. It’s a standard HID usage for pointing devices. This data is wired to mouse events on Mac and accessible in pointer events on Windows. A request has been made to add a GUID_PACKETPROPERTY to Windows to make access more standard. It is in use by shipping devices.

Two more missing data elements are the Secondary Barrel Switch (HID Usage 0x5A)

Would that not be exposed as part of button/buttons ?

Yes, it should be. I just want to make sure to gets wired in.

and Transducer Serial Number (HID Usage 0x5B)

Again, that feels out-of-scope here (though perhaps, leaving it up to implementations, it "could" be used to ensure that the pointer relating a particular pen always gets the same pointerId ?

pointerId isn’t persistent enough. Serial number is used to persist brush settings (Painter) or all settings via Cloud login (Adobe). This is now a standard HID usage for pointing devices, and has been wired to mouse events on the Mac. A request has been made to add a GUID_PACKETPROPERTY to Windows to make access more standard. In the future you can expect essentially all electrostatic styli to have a unique serial number to enable these and other associations.


Reply to this email directly or view it on GitHub #25 (comment).


Living on Earth is expensive, but it does include a free trip around the sun.

@patrickhlauke
Copy link
Member

There’s nothing vendor specific here.

and I didn't say there was. What I'm saying is that within the definition of what we're concerned with in this working group/with this specification, this doesn't seem to fit.

Two more missing data elements are the Secondary Barrel Switch (HID Usage 0x5A)

Would that not be exposed as part of button/buttons ?

Yes, it should be. I just want to make sure to gets wired in.

I'd say let's open a new issue for that specifically. Also, clarify if this is not catered for in the current spec https://w3c.github.io/pointerevents/#the-button-property (which already covers left, middle, right, x1, x2). Keeping in mind that it's also up to browser developers, device manufacturers, etc to do the correct wiring up, which isn't something the spec itself can address.

pointerId isn’t persistent enough. Serial number is used to persist brush settings (Painter) or all settings via Cloud login

As Rick already noted, this opens a whole can of privacy worms which is already bad enough for native applications, but can be even more complex/dangerous if exposed to the web itself, and something that presumably would apply to all sorts of HIDs, not just pen/mouse - therefore probably better suited to an upstream, more general spec like UIEvents.

@patrickhlauke
Copy link
Member

split out the barrel pressure discussion into its own issue. refocusing this issue to be specifically only about rotation / twist (HID digitizer 0x41). i'd be in favor of adding this if we can get a sense of what values we get (presumably something that denotes the angle 0-359)

@patrickhlauke patrickhlauke changed the title Add Pen Rotation Add additional digitizer/pen attributes: twist (rotation) May 23, 2016
@dfleck
Copy link

dfleck commented May 24, 2016

On Windows it’s 0.0 to 360.0 degrees of a pen device around its own major axis (such as when the user spins the pen in their fingers) with a default of 0.0

Dave

On May 23, 2016, at 3:13 PM, Patrick H. Lauke notifications@github.com wrote:

split out the barrel pressure discussion into its own issue. refocusing this issue to be specifically only about rotation / twist (HID digitizer 0x41). i'd be in favor of adding this if we can get a sense of what values we get (presumably something that denotes the angle 0-359)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub #25 (comment)


With the blood in the ink of the headlines
And the sound of the crowd in my ear
You might ask what it takes to remember
When you know that you've seen it before
Where a government lies to a people
And a country is drifting to war
-- Jackson Browne "Lives in the Balance" 1986

@patrickhlauke
Copy link
Member

In the call today (https://www.w3.org/2016/05/25-pointerevents-minutes.html) the question about actual devices that support rotation came up. This Wacom art pen (compatible with Intuos Pro) https://us-store.wacom.com/Product/Art-Pen-S01 supports rotation.

@RByers
Copy link
Contributor

RByers commented May 25, 2016

Oh right, we do have one of those. If it's easy to get this value from the underlying OS, I doubt we'd have any hesitation to exposing it in Chrome (just a little bit of plumbing).

@patrickhlauke
Copy link
Member

we do have one of those

Note that this is not the pen that comes with the Intuos Pro by default (the picture seems incorrect, as the description states "This cordless, battery-free Art Pen features a broad, chisel-shaped pen tip"). If I had a slush fund, I'd purchase this one and the airbrush for testing... (nudge nudge ;) )

@patrickhlauke
Copy link
Member

I guess this also answers the question/concern that @teddink had about it needing to be supported in Windows. And possibly even @shepazu's suggestion that this may be "at risk", as it's actually available in the wild (though granted not very common)?

@patrickhlauke
Copy link
Member

@dfleck mentioned to me on email just now that it should be straightforward to get this from the underlying OS on Windows at least - see https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.input.pointerpointproperties.twist?f=255&MSPPError=-2147217396

@smaug----
Copy link
Contributor

Is the feature supported on any other platform?
Does anyone know how common the relevant devices are?

@patrickhlauke
Copy link
Member

Is the feature supported on any other platform?

In the case of the Wacom tablet and art pen, assuming the correct drivers are installed, it is supported (and it's a standard USB HID feature).

As for the "how common" question: considering that tiltX and tiltY support is also not very common (for instance only the "Pro" Wacom Intuos supports it, while all cheaper tablets in that range don't; also, Surface Pen has no tilt support), but it's in the spec already, I would say that shouldn't be a limiting factor here?

@smaug----
Copy link
Contributor

Well, in general we can't add web API for all the possible existing devices. And we (== web API designers) tend to add new APIs too easily and then later realize that we did something wrong and need to fix our mistakes. So that is why I'm just asking whether we think there will be use for these new attributes. But sounds like there might be enough use cases and device and OS support.

(I'm assuming here that Web USB won't cover this use case.)

@skibulk
Copy link
Author

skibulk commented May 26, 2016

On the other hand, having software support for a feature encourages
manufactures to fall in line.

On Thu, May 26, 2016 at 4:17 PM, smaug---- notifications@github.com wrote:

Well, in general we can't add web API for all the possible existing
devices. And we (== web API designers) tend to add new APIs too easily and
then later realize that we did something wrong and need to fix our
mistakes. So that is why I'm just asking whether we think there will be use
for these new attributes. But sounds like there might be enough use cases
and device and OS support.

(I'm assuming here that Web USB won't cover this use case.)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#25 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants