Appendix K
Changing Keyboard Shortcuts:
Modifying the Shortcut File

You can change keyboard shortcuts in Dreamweaver either by using a previously unused shortcut or by reassigning an existing shortcut to a different menu item. In the next section, I discuss using Dreamweaver's Keyboard Shortcut manager (Figure 1). The appendix you are reading is for people who would rather reassign keyboard shortcuts by editing the menus.xml file instead of using a dialog box.

Figure 1. Dreamweaver features a new, easy-to-use Keyboard Shortcut Manager. I discuss using this dialog box in the next section.

Tips

  • Make a backup of the discussed files before modifying them.
  • You'll be working with a file called menus.xml. This file is located within the Dreamweaver Configuration folder. This folder can be found in the following location:
    Windows: C:\Program Files\Macromedia\Dreamweaver MX 2004\Configuration\Menus
    Macintosh: Hard Drive: Applications: Macromedia Dreameaver MX 2004: Configuration: Menus
  • On multi-user systems, you will not be able to modify this file unless you are the administrator. Each user is given a numbered configuration folder in the main configuration folder; don't use these. Instead, look in the user's personal application data folder, as follows:
    Windows: C:\Documents and Settings\USERNAME\Application Data\Macromedia\Dreamweaver MX 2004\Configuration\Menus
    Macintosh: Hard Drive: USERNAME: Library: Application Support: Macromedia: Dreameaver MX 2004 : Configuration: Menus
  • The Macromedia Web site includes a Keyboard Shortcut Matrix (Figure 2) that displays standard key combinations and the command attached, if any. The location online is:
    www.macromedia.com/go/dreamweaver_mx_shortcuts.

Figure 2. The Keyboard Shortcut Matrix lists all existing and empty keyboard shortcuts in Dreamweaver.

To change a keyboard shortcut:

  1. Quit Dreamweaver.

  2. Open a working copy (and make a pristine backup) of menus.xml in your favorite non-Dreamweaver text editor.

  3. If you're adding a new keyboard shortcut that doesn't need to be reassigned, skip to step 6.
  4. If you need to remove references to your shortcut first, locate in the menus.xml file the menu command that contains the shortcut you want to use, and copy the shortcut (Ctrl+C/Cmd+C).

  5. Open the Find feature of your text editor, and paste (Ctrl+V/Cmd+V) the shortcut into the Find What text box.

  6. Find each instance of the shortcut in the menus.xml document, and delete each one. The key attribute will read key="".

  7. Find the menu item to which you want to assign the new shortcut.

    If the menu item already has a shortcut, select it and paste the shortcut over it (Figure 3).

    Figure 3. I'm changing every reference to the Properties inspector to indicate my new shortcut. By using "Cmd" instead of "Ctrl," my shortcut will work on both Windows and the Mac. That way, I can share my shortcuts file between computers and make changes only once.

    If the menu item does not have a shortcut, you need to add the key attribute:

    key="Ctrl+Shift+P"

  8. Don't touch the ID attribute.

  9. Save your file as menus.xml in the Menus folder.

  10. Launch Dreamweaver and test the new shortcut. The menu item should also indicate the new combination (Figure 4).

    Figure 4. You can see, in the Window menu, that I changed the keyboard shortcut for displaying the Properties inspector. Note that "Cmd" shows up as "Ctrl" on the PC. On the Mac, it would be displayed as the butterfly symbol that's on the Command key.

Tip
  • If a shortcut is assigned to two different menu items, the first pairing listed in menus.xml will be the working combination. That means it's especially important to make the changes in the keyboard shortcuts section at the top of the menus.xml file.