Skip to content

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.

One
Two
Three
bit Blow

Try 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 the KeyboardEvent.key names that delete the selection; DeleteKeyEnabled (true) switches the binding off altogether. The page passes ["Delete"] for Delete only.
  • ZoomActivationKey (null) is a BlowModifierKey that 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, and Enter on another node completes it; null turns 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 - PanActivationKey and SelectionKey - are on Selection Gestures.
An unhandled error has occurred. Reload 🗙