How can I trigger diagram panning via right mouse button down?

It’s the default way to trigger the diagram panning via left click and move immediately.

For now, I set the defaultTool in diagram to be panningTool in a mousedown action. And do the change in doMouseMove() method in panningTool. But there are still too many properties I shall set and change.

I just want to retain the default panning action while change the trigger to right click. Is there any easy acess?

You should be able to accomplish this by overriding PanningTool.canStart. But it appears that there is a bug with InputEvents for right mouse drags. We need to investigate this.

Really a nice setting!

Here is another question:
I tried to get the keyboard input with lastInput.key in a click action like toolManger.doMouseDown. But it did not return the current keyboard input but the previous input. And for now, if I want to get the right input, I can only keep pressing the key and click twice or more. While the lastInput.ctrl performs correct. Is it right to catch the keyboard input in a mouse action like this?

To respond to keyboard input, override the http://gojs.net/latest/api/symbols/Tool.html#doKeyDown method.