WICG / input-device-capabilities

InputDevice API proposal
MIT License
17 stars 14 forks source link

Add property for whether dragging the pointer scrolls #22

Open RByers opened 8 years ago

RByers commented 8 years ago

In the Pointer Events hackathon it was discussed that there's no good way to know if a user would expect a pointermove event to trigger scrolling. Eg. for a library trying to implement a custom scroller that behaves like the native OS scrollers (eg. iScroll). A naive thing to do is to trigger scrolling for pointerType="touch" only, but that won't handle the case of touch-like stylus devices (eg. Samsung SPen).

We should just add a new property to InputDeviceCapabilities that indicates whether this is a pointer where movement typically causes scrolling. For chromium this will probably always have the same value as firesTouchEvents.

/cc @scottgonzalez @jacobrossi @mustaqahmed @dtapuska @tdresser

RByers commented 8 years ago

Probably the main question here is what the property name should be. Ideas:

tdresser commented 8 years ago

Should the name be specific to scroll? Or should it also refer to whether pointers can cause zoom?

RByers commented 8 years ago

I think it should be scroll-specific. Eg. I think the SPen can scroll but not zoom (and if not, certainly it would be reasonable for some pens to act that way).

RByers commented 8 years ago

Note that it's tempting to describe this as "is direct manipulation" - i.e. is the input metaphor one where the user is directly grabbing things on the screen. I think I'll put some text like that in the prose, but IMHO it's probably best to keep the property name very concrete around a specific capability.

RByers commented 8 years ago

Let's leave this issue open until there's been some more discussion and the tests and polyfill have been updated (not something I expect to do before I get back from vacation late Aug).