Search code examples
three.jsorbitcontrols

Enable right click menu while using OrbitControls


In Three.js, I would like to enable the context menu in order to let the user save the canvas upon right click on the image, while using OrbitControls.

Disabling OrbitControls with controls.enabled = false; makes the right click menu come back, but obviously disables the controls. Only disabling the right click pan doing controls.enablePan = false; does not enable the right click menu.


Solution

  • You can't configure the behavior that you are looking for. So you have to modify OrbitControls by simply removing the internal onContextMenu() event listener.