Key Bindings
Which keys the canvas claims is up to you. A flow embedded in a long page usually should not swallow Backspace or hijack the scroll wheel, so this one starts with the delete keys narrowed to Delete and the wheel zooming only with Ctrl held. DeleteKeys, ZoomActivationKey, MultiSelectionKey, ConnectionKey and SelectAllKeyEnabled each pick a key or turn one off.
Press Tab to move between the nodes and edges of the diagram.
Press Enter or Space to select it, Shift with Enter to add it to the selection, the arrow keys to move the selected nodes, Delete to remove them and Escape to clear the selection. Press C to start a connection from it.
Press Enter or Space to select it, Delete to remove it and Escape to clear the selection. Press C to move its end to another node.
bit BlowTry it
- Click a node to select it and press Delete: it goes. Select another and press Backspace: with Delete only nothing happens, so Backspace keeps meaning whatever it means to the page. Delete + Backspace lets both delete, and Disabled neither.
- Scroll over the canvas: with Zoom needs set to Ctrl the page scrolls past it. Hold the chosen key and scroll to zoom; pick nothing and a plain scroll zooms again.
- Hold the Multi-select key and click nodes or edges to add each to the selection. With it left at Shift, Shift+drag on the background draws a box that adds to the selection too.
- Tab to the node One and press the Connect key (C), Tab on to Three and press Enter: an edge from One to Three is drawn. Pick K to move the binding, or Off to turn connecting from the keyboard off.
- With the canvas focused press Ctrl+A (Cmd+A) to select everything, then untick Ctrl+A selects all: the shortcut is left to the browser.
- Reset brings back the three nodes and their edges.
How it works
DeleteKeys(["Delete", "Backspace"]) are theKeyboardEvent.keynames that delete the selection;DeleteKeyEnabled(true) switches the binding off altogether. The page passes["Delete"]for Delete only.ZoomActivationKey(null) is aBlowModifierKeythat must be held for the wheel to zoom; without it a plain scroll reaches the page. Ctrl+wheel - how browsers report a trackpad pinch - always zooms.MultiSelectionKey(BlowModifierKey.Shift) adds to the selection on a click, and makes a selection box add to what is selected.SelectAllKeyEnabled(true) binds Ctrl/Cmd+A to selecting every selectable, visible node and edge; turned off, the canvas leaves the key alone.ConnectionKey("c") starts a connection from the focused node, andEnteron another node completes it;nullturns connecting from the keyboard off. It is ignored with Ctrl, Cmd or Alt held, so Ctrl+C still copies.- The canvas acts on these keys only while focus is in the flow, and never while you type in a field inside it. The keys that change what a drag does -
PanActivationKeyandSelectionKey- are on Selection Gestures.