I’m trying to figure out one way to trigger selectionHelper only when left mouse clicked. In my case, my right mouse is used for rotating orthographic camera. So it’s really annoying when you rotate around object and selection box indicator appear.
SelectionHelper
use the Pointer Events API for implementing the interaction. Since an instance of PointerEvent
inherits from MouseEvent
, you can evaluate which mouse button was pressed by checking the button property. A value of 0
represents the main button which is usually the left mouse button.
Based on this background, you can enhance the pointerdown
and pointerup
event listeners of SelectionHelper
like so:
this.onPointerDown = function ( event ) {
if ( event.button === 0 ) {
this.isDown = true;
this.onSelectStart( event );
}
}.bind( this );
this.onPointerUp = function ( event ) {
if ( event.button === 0 ) {
this.isDown = false;
this.onSelectOver();
}
}.bind( this );
In this way, the selection box is only triggered by the left mouse button.
1 Like
Thank you!