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

fuzihaofzh picture fuzihaofzh  路  3Comments

alexprut picture alexprut  路  3Comments

makc picture makc  路  3Comments

akshaysrin picture akshaysrin  路  3Comments

filharvey picture filharvey  路  3Comments