canvas: expose touch pressure (as event.force) in the touch script.
This commit is contained in:
parent
cb68a80309
commit
447729443f
3 changed files with 9 additions and 1 deletions
|
|
@ -1,5 +1,10 @@
|
|||
# Changelog
|
||||
|
||||
## 1.13.2
|
||||
|
||||
- widgets
|
||||
- canvas: expose touch pressure (as `event.force`) in the `touch` script.
|
||||
|
||||
## 1.13.1
|
||||
|
||||
- bug fixes
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ This script has access to the same variables and functions as the `script` prope
|
|||
- `movementX`, `movementY`: movement of the pointer in pixels since the last event
|
||||
- `pointerId`: unique identifier used to differenciate fingers in multitouch situation
|
||||
- `altKey`, `ctrlKey`, `shiftKey`: keyboard modifier states
|
||||
- `force`: amount of pressure applied to the touch surface between `0` and `1` (see [Touch.force](https://developer.mozilla.org/en-US/docs/Web/API/Touch/force)). Equals `0` if the API is not supported or if no pressure information is found.
|
||||
|
||||
|
||||
### `draw`
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ module.exports = {
|
|||
traversing: e.traversing,
|
||||
traversingStack: e.traversingStack,
|
||||
multitouch: e.multitouch,
|
||||
isTouch: e instanceof Touch
|
||||
isTouch: e instanceof Touch,
|
||||
force: e.webkitForce || e.force || 0
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue