I want to activate camera rotation while mouse button in down.
so, I used pointerLockControls for that.
First, I used “mousedown” event to activate controls and deactivate it with “mouseup” event.
till this all things are going as expected.
but “click” event is not triggered after that.
controlsPointer = new PointerLockControls(camera, document.body);
window.addEventListener("mousedown", function(event){
controlsPointer = new PointerLockControls(camera, document.body);
controlsPointer.lock();
onMousedown(event)
});
window.addEventListener("mouseup", function (event) {
controlsPointer.unlock();
})
window.addEventListener("click", (event) => {
console.log(event)
console.log("clicked")
})