Hello,
I have a PointerDragBehavior, and I was trying to make it drag only on left click (it seems like a basic feature a lot of dev might want to use : actions are often different depending on the mouse button you use).
Sadly, I found no easy way to do it. The currentDraggingPointerID doesn’t seem to bring any button info…
So I had to change the dragBehavior._pointerObserver.callback to do it :
const currentCallback = dragBehavior._pointerObserver.callback;
dragBehavior._pointerObserver.callback = (pointerInfo, eventState) => {
if (pointerInfo.event.button !== 0 && pointerInfo.event.type !== "pointermove") {
return;
}
currentCallback(pointerInfo, eventState);
};
It’s working, but it’s not really nice to have to do this sort of thing just to drag on left click only…
Am I missing something ? If not, it would be nice to add a allowed mouse button(s) parameter to the PointerDragBehavior, and maybe to the gizmos too.