#

## tool

Change the layout "tool" (button bindings). This page describes the version of the command used by the Tcl version of magic.

### Shortcuts:

> Key macro space implements the command tool.
> Key macro shift-space implements the command tool box.

### Usage:

> tool [name|info]

> > where name may be one of box, wiring, netlist, or pick.

### Summary:

> The tool command selects or queries the mode of operation of the mouse buttons in the layout window. Each tool type has a unique set of button bindings.

> Without arguments, the tool command selects the next tool type in round-robin fashion. With a tool type as argument, the button bindings switch to those for the indicated tool. With the info option, a summary of the commands bound to each mouse button is given for the current tool.

> The default mouse bindings for each of the three tools is as follows:

> - Box Tool
>   left
>     Move the box so its lower-left corner is at cursor position
>   right
>     Resize box by moving upper-right corner to cursor position
>   middle
>     Paint box area with material underneath cursor
>   In addition, you can move or resize the box by different corners by pressing left or right, holding it down, moving the cursor near a different corner and clicking the other (left or right) button down then up without releasing the initial button.
> - Wiring Tool
>   left
>     Pick wire material and size from under the cursor and begin interactive wire placement.
>   right
>     Cancel interactive wire placement.
>   middle
>     Place a wire at the position shown by the interactive wire tool highlight box, and continue interactive wire placement.
>   shift-left
>     Change the type of wire to the next plane (e.g., metal1 to metal2)
>   shift-right
>     Change the type of wire to the previous plane (e.g., metal2 to metal1)
>   shift-middle
>     Place a contact at the current location and switch to the wire type on the next plane.
>   scrollwheel up
>     Increase the wire size by one unit
>   scrollwheel down
>     Decrease the wire size by one unit
>   Note that the methods for the wire tool differ significantly between Tcl-based magic, with its interactive capabilities, and non-Tcl-based magic.
> - Netlist Tool
>   left
>     Select the net containing the terminal nearest the cursor
>   right
>     Toggle the terminal nearest the cursor into/out of current net
>   middle
>     Join current net and net containing terminal nearest the cursor
> - Pick Tool
>   left
>     Remove the current selection from the layout, place it in the pick buffer, and follow the cursor.
>   right
>     Cancel the current pick buffer and stop following the cursor.
>   middle
>     Place a copy of the pick buffer at the current location, and continue following the cursor.
>   shift-middle
>     Make a copy of the current selection from the layout, place it in the pick buffer, and follow the cursor.
>   The pick tool is an interactive feature only available in the Tcl-based version of magic.

### Implementation Notes:

> tool is implemented as a Tcl script in the Tcl-based version of magic. The command duplicates the function of the original tool command, which remains for the non-Tcl based version of magic, and which performs the function of changing the cursor style in the window.

> Button functions for each "tool" may be added to or modified in the startup scripts. The Tcl variable Opts(tool) contains the current tool name, and may be used by a user tool procedure overriding the default one in "tools.tcl".

### See Also:

> tool (non-Tcl version)

Return to command index

Last updated: December 4, 2005 at 5:25pm