yishn / tikzcd-editor

A simple visual editor for creating commutative diagrams.
https://tikzcd.yichuanshen.de/
MIT License
1.88k stars 99 forks source link

Keyboard grid cell navigation #39

Open ComFreek opened 5 years ago

ComFreek commented 5 years ago

When within one node, I'd suggest that pressing one of the arrow keys navigates the user to the desired node.

Maybe Ctrl-arrow key also adds an edge.

yishn commented 5 years ago

I'm not sure how you envision the keyboard shortcuts. When you're within one node, you're inside a text box, editing the LaTeX code for that node. Pressing arrow keys should move the caret of that text box.

ComFreek commented 5 years ago

You're right, arrow keys on their own would break normal editing.

Personally, having such a feature would certainly be useful, so one might consider overwriting one of the keyboard shortcuts above. Or what about mirroring Excel a bit and having two modes: edit mode within one node and normal mode. In normal mode a single node is always selected. The selection can be moved with the arrow keys. Hence, the workflow for entering "A B" would be:

Maybe pressing Shift-arrow key in normal mode moves the selection while also adding an arrow.