10.3.1.7 Keyboard Settings

The shortcut key combinations in the scheme currently applied (Default), depending on the settings you have selected and any customizations you might have made. Visual Studio also includes seven other keyboard mapping schemes, each of which differs from the others in the shortcut key combinations assigned by default to various UI elements.

Commands with shortcut key combinations that are part of the Global scope can be superseded by commands in other scopes depending on the current context of the integrated development environment (IDE). For example, if you are editing a file, commands that are part of the Text Editor scope have precedence over commands in the Global scope starting with the same key combination. For example, if several Global commands have key combinations starting with CTRL + K and the Text Editor has several commands with key combinations that start with CTRL + K when editing code, the Text Editor key combinations will work, and the Global key combinations ignored.

Note: The options available in dialog boxes and the names and locations of menu commands you see might differ from what is described in Help, depending on your active settings or edition. This Help page was written with General Development Settings in mind. Choose Import and Export Settings to change your settings from the Tools menu. For more information, see Working with Settings.

Determine the Shortcut Key Assigned to a Command

You can manually search for a command to determine whether or not it has an assigned shortcut key combination.

To Determine the Shortcut Key Combination for a Command

  1. On the Tools menu, click Options.
  2. Expand the Environment folder and select Keyboard.
    Note: If you do not see the Keyboard page, check “Show all settings” located in the lower left of the Options dialog box.

    In the Show commands containing box, enter the command name without spaces, for example, solutionexplorer.

  3. In the list, select the correct command.

    For example, View.SolutionExplorer.

  4. If a shortcut key combination exists for the command, the combination appears in the Shortcut(s) for the selected command drop-down list.

Create Custom Shortcut Keys

You can create new shortcut key combinations for any command or change the shortcut key combination for commands with existing combinations.

To Create a New Shortcut Key Combination

  1. On the Tools menu, click Options.
  2. Expand the Environment folder, and select Keyboard.
    Note: If you do not see the Keyboard page, check “Show all settings” located in the lower-left corner of the Options dialog box. In the Show commands containing box, enter the name of the command without spaces.

    For example, solutionexplorer.

  3. Select the command you want to assign to a shortcut key combination in the list.
  4. On the Use new shortcut in the drop-down list, select the feature area in which you want to use the shortcut. For example, you can choose Global if you want the shortcut to work in all contexts. Unless the same shortcut is mapped (as Global) in another editor, you can use it. Otherwise, the editor overrides the shortcut.
    Note: The following keys cannot be assigned to a command in Global: PRINT SCRN/SYS RQ, SCROLL LOCK, PAUSE/BREAK, TAB, CAPS LOCK, INSERT, HOME, END, PAGE UP, PAGE DOWN, Windows logo keys, Application key, any of the ARROW keys, or ENTER; NUM LOCK, DEL, or CLEAR on the numeric keypad; or CTRL+ALT+DELETE.
  5. Place the cursor in the Press shortcut key(s) box, and then use the keyboard to enter the key combination you intend to use for the command.
    Note: Shortcuts can contain the SHIFT, ALT, and/or CTRL keys in combination with letters. Be sure to check the Shortcut currently used by the box to see if the key combination is already assigned to another command in the mapping scheme. Press BACKSPACE to delete the key combination if the combination is already in use before trying another combination.
  6. Click Assign.
    Note: Changes made by using the Assign button are not canceled if you click the Cancel button.

Exporting and Importing Shortcut Keys

You can share the shortcut key combinations in the current keyboard mapping scheme by exporting the information to a file so others can import the data.

To Export Shortcut Keys Only

  1. On the Tools menu, choose Import and Export Settings Wizard.
  2. Select Export select environment settings, and then click Next.
  3. Under What settings do you want to export?, clear all categories selected by default.
  4. Expand Options and then expand Environment.
  5. Select Keyboard and then click Next.
  6. For What do you want to name your settings file?, enter a name and then click Finish.

To Import Only Shortcut Keys

  1. On the Tools menu, click Import and Export Settings Wizard.
  2. Select Import select environment settings, and then click Next.
  3. Click No, import new settings, overwrite my current settings, and click Next.
  4. Under My Settings, select the settings file that contains the shortcut keys you want to import or click Browse to locate the correct settings file.
  5. Click Next.
  6. Under Which settings do you want to import?, clear all categories.
  7. Expand Options and then expand Environment.
  8. Select Keyboard and then click Finish.