next up previous contents index
Next: Using VMD as Up: Tips and Tricks Previous: Tips and Tricks

Customizing the Popup Menu and the Hot Keys

  When the mouse is in the graphics display window, you can perform commands by selecting items from the VMD popup menu (accessed by pressing the right mouse button), and by using keyboard hot keys. This section describes how to customize the popup menu and hot keys to your individual preference.

Customizing the popup menu

The popup menu in VMD has a number of default menu items and submenus, which cannot be changed. These are described earlier, in section. But you can add new submenus and items to this menu, and assign text commands to those items. When the items are selected by the user, the assigned text command will be executed as if it had been typed in at the console. In fact, if Tcl is available in your version of VMD you can assign arbitrarily complex commands (as Tcl scripts) to a single menu selection.

To add new menu items, use the user add item text command. This command is only available by typing it in at the VMD command prompt in the console window. (You can, however, put many of these commands in a script and execute it via the play command. This is discussed later in this section.) The syntax is: user add item < name> [ text command] name is the name of the item as it will appear in the popup menu. Menu items added with this command will appear in a submenu User Commands off the main popup menu. Any text in the user add item command following name will be used as the text command to execute when the menu item is selected.

If you wish to put separators between commands, use the command user add separator which will put a line at the current end of the User Command submenu.

New submenus can also be added, to add more organization to the popup menu. To add a new submenu to the main popup menu, use the command: user add menu < name> name will appear as a submenu off the main menu. Note that the menu is initially empty, and will not be displayed until at least one item is added to it. To add items to a previously added submenu, use the command: user add subitem < menu> < name> [ text command] This works just as before, but you must also specify the name of the submenu to which the item should be added. Finally, you can also add separators to a new submenu: user add subseparator < menu>

If you wish to see the current definitions of the user-customized menu items, use the command user print menus This will print out to the console the names and associated text commands for all menu items added by the user.

Customizing the hot keys

In a very similar fashion, VMD keeps a list of user hot keys, which when pressed will result in an associated text command being executed as if it had been typed at the console. There are a number of predefined hot keys, as listed in table 3.1. The current state of these can be printed out with the command user print keys And in the same fashion as for the popup menu, the commands attached to these hot keys can be customized by the user.

To add/modify a hot key, use the command user add key < key> [ text command] key must be a single character. When that key is pressed while the mouse cursor is in the graphics display window, the associated command will be executed.

Automatically loading customization commands

Once you have discovered a set of commands which are particularly useful and familiar for you, you will want to have these popup menu commands and hot key commands automatically available every time you run VMD . This can be done by placing the commands to add these items in your .vmdrc file, which is a file containing VMD text commands that is executed every time VMD starts up. The basic method for setting up this file is described in a later section (.vmdrc file). Once you have such a file, just put the add user commands in it, and you will have your own specialized version of VMD .



next up previous contents index
Next: Using VMD as Up: Tips and Tricks Previous: Tips and Tricks



Andrew Dalke
Tue May 14 16:49:45 CDT 1996