[code] function ShiftLinkingTool() {
go.LinkingTool.call(this);
}
go.Diagram.inherit(ShiftLinkingTool, go.LinkingTool);
ShiftLinkingTool.prototype.canStart = function() {
if (!go.LinkingTool.prototype.canStart.call(this)) return false;
return this.diagram.lastInput.shift;
};[/code]
Then you can replace the Diagram’s standard LinkingTool:
myDiagram.toolManager.linkingTool = new ShiftLinkingTool();
Tool.canStart is called to see if that Tool should start running as the Diagram.currentTool. Even if the predicate were to return true, the tool is not yet running. And once it is running does not mean it is active.
You can override either Tool.doStart or Tool.doActivate to implement custom behavior at those respective times.