I believe this is a mistake and I tracked the violating code. I will write a bug report and pull out a request next week (although I'm still not sure that my solution will not break something else).
The problem is that Hammer adds all listeners to the very first element (which, however, leads to receiving your event for each element to which you add a recognizer, adds 4 press listeners, and your callback is called 4 times for each click )
I managed to create press and swipe events (with emulation of the touch device via Chrome, as well as with an authentic iPad and Nexus 7). I have not checked other events yet.
I just changed line 946 (from Hammer 2.0.4) from
this.evTarget = TOUCH_TARGET_EVENTS;
to
this.evEl = TOUCH_TARGET_EVENTS;
Note that you may need to make the same change to line 878, but I have not really figured out where, when or when the SingleTouchInput class is SingleTouchInput .
As I said, I'm not sure if this is the right solution, but it is certainly a workaround. I will report back if I find any problems or unwanted side effects.
Lambart
source share