I want to use two-finger gestures on the trackpad to move an object in the browser up/down, left/right, and zoom in/out.

Conclusion.

  • These operations are communicated to the browser in the wheel event.
  • deltaX, deltaY contain the amount of vertical and horizontal movement
  • ctrlKey: true for pinch
  • The wheel event is PASSIVE by default, so to stop the browser’s default clone operation, you must first turn PASSIVE off.

---memo from pMovidea Parallel movement on Macbook touch screen


This page is auto-translated from /nishio/Macbookのトラックパッドで拡大縮小平行移動 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.