Demo for Vanilla Gesture
configurable input gestures that work with both touch and mouse input clicked swipe

clicked

clicked(element, () => ...)
click the blue box
clicked(element, () => ..., { doubleClicked: true, clicked: false })
double click the blue box
clicked(element, () => ..., { longClicked: true, clicked: false })
long click the blue box
clicked(element, () => ..., { doubleClicked: true, longClicked: true})
click, double click, or long click the blue box
clicked(element, () => ..., { doubleClicked: true, doubleClickedTime: 1000, clicked: false })
slow double click the blue box
clicked(element, () => ..., { longClicked: true, longClickedTime: 1000, clicked: false })
long click the blue box for at least 1 seconds
clicked(element, () => ..., { mouse: 'right', longClicked: true, doubleClick: true })
right click, right double click, or right long click the blue box
clicked(element, () => ..., { mouse: false, doubleClicked: true, longClicked: true })
touch click, touch double click, or touch long click the blue box

swipe

swipe(element, () => ...)
swipe horizontally or vertically
swipe(element, () => ..., { direction: 'horizontal' })
swipe horizontally
swipe(element, () => ..., { direction: 'vertical' })
swipe vertically
swipe(element, () => ..., { mouse: false })
swipe only with finger
swipe(element, () => ..., { touch: false })
swipe only with mouse
swipe(element, () => ..., { mouse: 'right' })
swipe only with right mouse button or touch
Fork me on GitHub