Search code examples
javascriptjquerygoogle-chrometouchgesture

Is it possible to have gestures with trackpads?


On a Macbook Pro in Chrome, sliding two fingers across the screen allows you to move backwards and forwards. How do I go about disabling this, and creating custom gestures in jQuery or Javascript?

All I really need to know is how do you detect when two fingers are on the trackpad, which I assume is the best way to do this. You can do it on mobile with e.touches!


Solution

  • Touchpads do not trigger touch-related events (but usually control the mouse pointer instead. This cannot be affected by a website for obvious reasons) so that's not possible.

    If gestures done on a touchpad have non-standard behaviour this is usually done by the touchpad's driver/software.