In the post Overriding draggingTool.moveParts - #6 by Hochware I stated that my diagram has grouping functionality and I am overriding computeEffectiveCollection in order to change the set of objects that are affected by “moveParts”. However, this does not work for moving objects with the arrow keys. I did not yet find any way to override this function. Any suggestions?
Yes, sorry I did not mention that. I did set “arrowKeyBehaviour” to “move”. I also set “commandHandler” in the diagram to “new DrawCommandHandler()”. Then I defined this:
I really do not know at all how this thing works…I do not know how to get the pressed key directly(of course there are other, ugly ways) and I get an error too:
You’ll need to change the DrawCommandHandler_arrowKeyMove method to do what you want. Instead of iterating over the Diagram.selection, iterate over the diagram.toolManager.draggingTool.computeEffectiveCollection(diagram.selection).iteratorKeys.
I encourage everyone reading this to use the grouping functionality provided by GoJS, all those problems (there are multiple posts, as well as other little problems I was able to solve on my own) emerged because I did not use this. Right now I am in the process of implementing those groups and it already solved some issues I was not able to solve before