[w3c/uievents] Standardize common gestures event (#293)

This Issue throws out a proposal on gestures.The purpose of the proposal is to solve the integration of commonly used gesture capabilities under Web standards. There are a variety of native gestures such as Pan, Long Press, Drag, etc. in client development. They are highly encapsulated which allows developers to It is more convenient to directly use these gesture capabilities to quickly develop some interactive pages with more complex interactions. 

The proposal expects further expansion on element. Developers can directly bind and monitor related gesture events on element, and throw related event parameters in the callback.

```javascript
element.addEventLisenter('swipe', (gestureEvent) => {
 //do something...
})
```

### gestures

* pan
* swipe
* longpress
* scale

Standardize [GestureEvent](https://developer.mozilla.org/en-US/docs/Web/API/GestureEvent).It can be further expanded to satisfy the basic parameters of gesture events.

* state: Some states of gestures,such as down、move、up.
* deltaX: X axis moving distance.
* deltaY:Y axis moving distance
* direction: The direction of the gesture, such as left、right、up、down.
* velocityX:X axis movement speed.
* velocityY:Y axis movement speed.
* scale: Zoom in or zoom out ratio.
* rotation:rotation.

### Some supplements

* Performance: the gestures can be used directly on the Web, rather than through frequent transmission and ultimately hijacking the Touch event at the JavaScript to achieve related gesture capabilities.
* Easy to use: Provide related gesture events directly on the Web, so that developers can directly use the gesture capabilities encapsulated on element.
* standardization: The gesture capabilities implemented by each platform and solution are different. It is expected that the Web platform will have a unified standardized gesture capability through a unified standard.

Is it possible?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/293

Received on Monday, 1 March 2021 10:10:32 UTC