0

I'd like to detect multi-finger taps and swipes. Eg. detect a two finger tap or a four finger swipe down as such. Using regular React and useGesture.

I'd like to know if it's even possible, because there's no mention of this in the docs. And any guidance to where I could find what I'm looking for (perhaps Ionic Gestures?)

J0hannes
  • 593
  • 5
  • 10

1 Answers1

0

For a multi-touch tap, you can detect a tap using (for example) the dragGesture.

When it comes to multi-touch swipe, I'm currently looking for that answer as well.

Set the option "filterTaps: true", and look at the "tap" and "touches" variables in the gesture state as defined here: https://use-gesture.netlify.app/docs/state/

const bind = useDrag(
({ tap, touches }) => {

  if (tap && touches > 1) {
    // Do stuff
  }

  ...

},
{
  filterTaps: true,
  useTouch: true,
})