MacBook Dual Channel Trackpad Detection Using JavaScript / jQuery

I wonder if there is a way to detect if the user made two fingers on the MacBook keyboard using JavaScript or jQuery. In one of the projects, I find a right-click with JavaScript and use it for some actions. Actually this does not work if you press a double track on the trackpad. Although in an action that works like a right click, but JavaScript cannot detect it like that.

Any clues?

+4
source share
1 answer

You can use mouse event buttonproperty - MDN link

  • A value of 1 will be a left click indicator
  • 2 .

jsFiddle

0

Source: https://habr.com/ru/post/1545110/


All Articles