w3c / input-events

Input Events
https://w3c.github.io/input-events/
Other
24 stars 16 forks source link

Should Device-Specific Edit Events say what Device-Independent Edit Event they will cause? #13

Open johanneswilm opened 8 years ago

johanneswilm commented 8 years ago

From @BenjamP on December 10, 2014 17:47

From MS Office Team

Copied from original issue: w3c/editing#25

johanneswilm commented 8 years ago

From @BenjamP on January 28, 2015 21:46

This is the best way to do feature detection and tell if a device-specific (DS) event is going to cause a DI event. Without this I don't know how a site could trust that a DI Event would happen and not just invoke behavior on DS events.

johanneswilm commented 8 years ago

From @chaals on June 3, 2015 9:51

Device-specific input events should say what behaviour they trigger. But for authors using them, they presumably want to define the behaviour in case the DI event isn't really handled.

onSomeDeviceAction(evt) { if (responsiveEvent) fireResponsiveEvent(theOneIwant); else doTheResponsiveEventThingManually(evt); }

The benefit to the author being that the platform implementation is likely more efficient?

The drawback being a mess of testing and figuring out if implementations really do what they claim. But how else do we get "casual" authors there from here?

johanneswilm commented 8 years ago

The question is a bit here what event we will be looking at. Say we have a user who triple clicks on some text which on Windows/Linux causes that paragraph to be selected. The device independent event will be "paragraph selection". But what will the device specific event be? Will it simply be three consecutive clicking events which combined with some JS-based checking where exactly the caret was at the time?

For good feature detection in JS, will this not mean that one needs to reimplement a lot of logic that is already present in the browser?

I am wondering about whether there are other ways of doing this -- for example for the browser to give back a list of all the device independent events that will be triggered by some action, possibly with a list of actions that cause this event. If the paragraph selection event is not implemented at all or it is triggered only by other types of events that do not include triple clicking, the JS editor developers may decide to implement it themselves.