Three.js: OrbitControls: disable in mousedown, no events triggered in mousemove

Created on 8 Sep 2020  路  2Comments  路  Source: mrdoob/three.js

In r120, disabling orbit controls on mousedown no longer triggers mousemove events when dragging. To reproduce add the following code to misc_controls_orbit.html. This worked in the last several releases. Thanks.

renderer.domElement.addEventListener('mousemove', ()=>{
   console.log('mousemove');
});
renderer.domElement.addEventListener('mousedown', (e)=>{
   controls.enabled = false;
});
renderer.domElement.addEventListener('mouseup', ()=>{
   controls.enabled = true;
});     
Question

Most helpful comment

Everything works as expected when I changed to the Pointer Events API. Thanks.

All 2 comments

OrbitControls was moved to the Pointer Events API with r120. Please try to register your mouse event listeners on the respective counterparts (e.g.pointerdown, pointermove etc.).

Everything works as expected when I changed to the Pointer Events API. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scrubs picture scrubs  路  3Comments

akshaysrin picture akshaysrin  路  3Comments

konijn picture konijn  路  3Comments

seep picture seep  路  3Comments

clawconduce picture clawconduce  路  3Comments