Closed AgileInteractive closed 1 year ago
Same for me ! right-click is reconized by "press" event if i have tap and press on same element.
Maybe it could be great to have with the event :
Then we could deal with it like that :
domElement.addEventListener("contextmenu", event => event.preventDefault());
domElement.addEventListener("tap", function(event){
if ( event.pointerType == "mouse" && event.button == 2 ) {
// do something
}
});
Pixi.js has the same thing, where it solved it just like you suggest.
You can access the original pointerEvent
event using event.live.srcEvent
.
I also added the recognizer option supportedButtons
in v2.1.4
:
const options = {
"supportedButtons" : [2]
};
const tap = new Tap(rectangle, options);
This option can also be used for Pan
and Press
.
Be aware, that Tap
uses pointerEvent.button
instead of pointerEvent.buttons
. The numbers differ between the two.
hey ty ty a lot for this quick update !
When I add a Tap event, using mouse as input will trigger the event on all buttons (left-, middle-, right-click, even forward/back-clicks).
How do I limit the Tap listener to only be used on left-click?