Get python access to selected node input/output socket


It’s possible in the node editor to “select” a node input by Shift+LeftMouseClick (in the screenshot above Emission > Strength and Material Output > Volume inputs are selected)
So I wonder if it is possible via python to know what is the input I highlighted.

For the wider picture, I wish to make a little addon that lets the user to pick an input, drag it and drop a new linked node with the starting value: eg I drag that Strength input from Emission node, release the mouse into empty space and then a new Value node gets created with a value of 6.000
Similarly it would work with RGBs and Vectors.

The inputs are numerated from ‘up’ to ‘down’ position in the node. So, in the image, your highlighted
input is ‘node.inputs[1]’.

Thanks for replying. What I would like to know is if it’s possible to retrieve the input [number] being clicked