PinchRecognizer checks the number of pointers for exactly what you pointed. (This is really checked in the superclass AttrRecognizer ). Therefore, it is really surprising that you find 3 pointers when you do not specify a pointer parameter, since the default is 2.
Anyway, I see two solutions. One of them is to write your own Pinch recognizer. Just look at hammer.js source code and modify the existing one, in fact it is smaller than the screen. The attrTest function is what you are looking for. Do not call the super method (which checks the number of pointers), just check that the number of pointers is less than or equal to what you want.
A simpler solution is to define a PinchRecognizer for each number of pointers you want. Therefore, if you want to detect 4 fingers or less, do it like this:
var mc = new Hammer.Manager(element); mc.add(new Hammer.Pinch({ event: 'pinch2', pointers: 2, threshold: 0 })); mc.add(new Hammer.Pinch({ event: 'pinch3', pointers: 3, threshold: 0 })); mc.add(new Hammer.Pinch({ event: 'pinch4', pointers: 4, threshold: 0 }));
Disclaimer: I have not tested this. You may need to call recognizeWith to bind all recognizers together.
source share