Catching Mac trackpad zoom

后端 未结 5 549
感动是毒
感动是毒 2020-12-24 03:32

Currently in my application i am catching the mouse wheel events and perform zoom in or out on a Canvas element. If user uses Mac and tries to perform zoom with the trackpad

5条回答
  •  鱼传尺愫
    2020-12-24 03:51

    As far as I know, the trackpad pinch doesn't trigger touch or gesture events, so Hammer.js will not detect it.

    I was able to simulate pinch detection in Chrome by using Hamster.js. It will trigger the mouse wheel event and you can use the delta to determine if the user is zooming in or out.

    This solution didn't work in Safari though.

提交回复
热议问题