Changing mouse cursor if hovering over invalid port when linking

The title may be a bit self-explanatory, but basically, if a user is trying to connect a link (or relink) to a port in which my linkingtool.linkValidation and relinkingtool.linkValidation says is a no-go, I’d like to temporarily change the mouse cursor from the hand to something else, to indicate that the link cannot be made.

I experimented with linkingTool.doNoLink and it works, but it requires the user let up on the mouse button first. I’d like to catch it sooner if possible. Any ideas on how best to achieve this effect?

Thanks much for any guidance or snippets!

I haven’t tried this, but I would set LinkingTool.portTargeted to set the Diagram.currentCursor depending on whether the first two arguments are null (didn’t find a valid port) or not (the valid port that was found nearby)

  $(go.Diagram, . . .,
          "linkingTool.portTargeted": function(rn, rp, tn, tp, forw) {
            myDiagram.currentCursor = (rp !== null ? "pointer" : "not-allowed");
      . . .

Hey Walter - just tried it and that works like a dream! Exactly what I was envisioning behavior-wise. Good stuff!