Passing from one node to another with keyboard


First of all, congratulations for this very nice library. I’m currently evaluating it for a project.

So, I was investigating into the CommandHandler class for keyboard inputs in the API, but I’m not sure if what I was thinking of is possible, that is, to jump from one node to another or from one group to another by using, let’s say, the tab key.

Meaning by that, when a node or a group is selected, then, hitting the tab key would select the next node or the next group into the diagram.

And also, would it be possible to use a node property for indexing which node or which group would be selected after hitting the key, programmatically (the order of the node for the selection), for example a ascending property and a descending property ?

Thanks for an eventual answer to those questions Smile

Have you looked at the DrawCommandHandler in the extensions directory?

That’s a custom CommandHandler that handles the arrow keys in one of three different ways, depending on its “arrowKeyBehavior” property. (The DrawCommandHandler also has other, unrelated commands that you probably don’t care about.)

You might want to do something similar, but checking for the “Tab” key and deciding how to change selection in your own app-specific manner.

Thank you Walter for pointing out the right direction. The DrawCommandHandler looks like a useful script to learn from. That and the Part.isSelected property modification, and it should be doable. I knew it but lacked of a little pointer for finding out the correct examples in the documentation. Thumbs Up