7. Basic tree editing using mouse and keyboard

7.1. Mouse Control
7.2. Keyboard Shortcuts

TrEd can be controlled both using keyboard and mouse. Most keyboard short-cuts relate to the active node, which plays a similar role to that of a cursor in a text editor. Almost all of the basic tree editing operations (such as navigation the active node along the tree, cut-paste operations on the tree, editing node content, etc.) can be achieved both using keyboard and mouse bindings. Custom bindings and commands may be added using macros (see Section 14, “User Macros”). Here is a brief overview of the basic editing operations:

7.1. Mouse Control

  • Clicking left or right mouse button on a node activates it.

  • Double clicking left mouse button on a node invokes Node->Edit Attribues command.

  • Double clicking left mouse button on the text of a node's attribute opens a prompt for editing the value of this attribute.

  • Dragging a node with left mouse button and dropping it on another node cuts the dragged node and its subtree and pastes it on the target node.

  • Dragging and dropping a node with right mouse button has the same effect as above, but this time, if the tree is too large to fit the window, the window scrolls forward the direction of dragging so that when the dragged node reaches an edge of the window it meets the edge of the tree in that direction at the same time.

  • Pressing the middle button and moving the mouse pointer while the button is pressed has the same “scrolling effect” described above, but without actually dragging any node.

7.2. Keyboard Shortcuts

Cursor keys may be used to activate another node in the structure. Use left/right to activate the nearest left/right brother-node of the active node and up/down to activate the active node's ancestor (parent)/its leftmost son.

Use Shift+left/Shift+right to activate the nearest node on the left/right of the active node within the active node's level.

Tab and Shift+Tab keys activate the next/previous node on the way along the tree structure.

Enter runs the Node->Edit Node ... command.

To edit the tree structure with keyboard only, use the shortcuts bound to the User-defined menu commands. Most important of those are:

Ctrl+Insert (Cut Subtree)

Cuts the whole subtree of the active node and stores it in an iternal clipboard. It may be then pasted as a subtree of any of the remaining nodes with the Paste Subtree command.

Shift+Insert (Paste Subtree)

Pastes the tree saved in an internal clipboard during the last call of the Cut Subtree command as a subtree of the active node.

Alt+G (Go to...)

Promts user to enter an ordinal number of a tree and displays the tree.

,comma” (View->Previous Tree)

Displayes the previous tree in the current file. Note that this shorcuts operates on the focused view only, even if button lock is pressed and all views are tied.

.dot” (View->Next Tree)

Displayes the next tree in the current file. Note that this shorcuts operates on the focused view only, even if button lock is pressed and all views are tied.