yishn / tikzcd-editor

A simple visual editor for creating commutative diagrams.

Home Page:https://tikzcd.yichuanshen.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keyboard grid cell navigation

ComFreek opened this issue · comments

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.

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.

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

  • arrow keys alone
  • Ctrl-arrow key is commonly used for "fast forward to next word" in edit controls, isn't it?
  • Alt-(left|right) is used in browsers for navigating back and forth.
  • Tab would inherently only support going to the right.

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:

  • [Website loads in "normal mode", the center node is selected]
  • Press A, then Enter
  • Press right arrow key
  • PressB, then Enter.

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