tiptaptop
v0.0.10
Published
A 0 dependency tiny gesture handler
Downloads
3
Readme
Ev
| Prop | Description | | --- | --- | | deltaX | Movement of the X axis. | | deltaY | Movement of the Y axis. | | deltaTime | Total time in ms since the first input. | | distance | Distance moved. | | velocityX | Velocity on the X axis, in px/ms. | | velocityY | Velocity on the Y axis, in px/ms | | velocity | Highest velocityX/Y value. | | direction | Direction moved. Matches the DIRECTION constants. | | offsetDirection | Direction moved from it’s starting point. Matches the DIRECTION constants. | | srcEvent | Source event object, type TouchEvent, MouseEvent or PointerEvent. | | target | Target that received the event. | | pointerType | Primary pointer type, could be touch, mouse, pen or kinect. | | isFirst | true when the first input. | | isFinal | true when the final (last) input. | | pointers | Array with all pointers, including the ended pointers (touchend, mouseup). | | changedPointers | Array with all new/moved/lost pointers. | | preventDefault | Reference to the srcEvent.preventDefault() method. Only for experts! |
CONSTs
| Const | Value | | --- | --- | | DIRECTION_NONE | 1 | | DIRECTION_LEFT | 2 | | DIRECTION_RIGHT | 4 | | DIRECTION_UP | 8 | | DIRECTION_DOWN | 16 | | DIRECTION_HORIZONTAL | 6 | | DIRECTION_VERTICAL | 24 | | DIRECTION_ALL | 30 |