You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SectionTool binds "mouseclicked" event and recieves the x/y coords to display the section-control-utility.
When left-mouse-button is clicked:
Unfortunately it also displays the section-control-utility AND the context menu when right-mouse-button is clicked:
From a UX perspective this behaviour is not ideal. Either the section-control-utility OR the context menu should appear.
To achieve this it is necessary to distinct between these two different clicks like:
switch(event.which){case1:
alert('Left Mouse button pressed.');break;case2:
alert('Middle Mouse button pressed.');break;case3:
alert('Right Mouse button pressed.');break;default:
alert('You have a strange Mouse!');}
_initSectionMode(){this.viewer.scene.input.on("mouseclicked",(coords)=>{if(!this.getActive()||!this.getEnabled()){return;}constpickResult=this.viewer.scene.pick({canvasPos: coords,pickSurface: true// <<------ This causes picking to find the intersection point on the entity});if(pickResult){constsectionPlane=this._sectionPlanesPlugin.createSectionPlane({pos: pickResult.worldPos,dir: math.mulVec3Scalar(pickResult.worldNormal,-1)});sectionPlane.on("destroyed",()=>{this._updateSectionPlanesCount();});this._sectionPlanesPlugin.showControl(sectionPlane.id);this._updateSectionPlanesCount();}});
Is there a way to distinct between left and right-mouse-button click in _initSectionMode()?
The SectionTool binds "mouseclicked" event and recieves the x/y coords to display the section-control-utility.
When left-mouse-button is clicked:
Unfortunately it also displays the section-control-utility AND the context menu when right-mouse-button is clicked:
From a UX perspective this behaviour is not ideal. Either the section-control-utility OR the context menu should appear.
To achieve this it is necessary to distinct between these two different clicks like:
Unfortunately the "mouseclicked" event does not deliver the originating event to distinguish these cases (https://github.com/xeokit/xeokit-bim-viewer/blob/master/src/toolbar/SectionTool.js#L143).
Is there a way to distinct between left and right-mouse-button click in _initSectionMode()?
I suspect this probably needs to be changed in https://github.com/xeokit/xeokit-sdk...
Any suggestions are welcome.
The text was updated successfully, but these errors were encountered: