I’d like to restrict the motion to horizontal axis when the Shift key is held down while dragging (no restrictions otherwise). I have a custom DoKeyDown function in my GraphViewWindow.cs which reads key codes from KeyEventArgs, but I suspect I’d have to read the key codes directly within ComputeMove. How would I do that?
Instead of overriding ComputeMove on your node class, override DoMove instead:
public override void DoMove(GoView view, PointF origLoc, PointF newLoc) {
if (view.LastInput.Shift)
this.Location = new PointF(newLoc.X, origLoc.Y);
else
this.Location = newLoc;
}