I am using dragselectingTool to be able to drag select multiple nodes/links:
this.diagram = $(go.Diagram, {
...
dragSelectingTool: $(
RealtimeDragSelectingTool,
{ isPartialInclusion: true, delay: 50 },
)
...
But i want this drag selection should be possible only when shift key is pressed else (if shift not pressed) the default behavior (panningTool) should be apply to diagram.
I was trying to do it like so:
const panningTool = this.diagram.toolManager.panningTool;
panningTool.canStart = () => {
if(!this.diagram.lastInput.shift && !this.diagram.selection.first()) {
return true
} else {
go.DragSelectingTool.prototype.doActivate.call(dragSelectingTool);
}
}
But it not working properly.
Is it better solution?