Detect key on node mouseDrop

Hi,

Is there a way to combine Node.mouseDrop and CommandHandler.doKeyDown to detect whether a key is pressed on node drop/inside mouseDrop?


- drop onto the diagram/single node => new node added to the diagram/link added between nodes.

  • Shift + drop onto an node => replace existing node with new node and update links


    Thanks!

The first argument to the GraphObject.mouseDrop event handler is an InputEvent.

So just look at e.shift in your event handler to decide whether to do the extra work.

Awesome! Thanks, Walter!