• No results found

Customize Keyboard Shortcuts

You can customize or view keyboard shortcuts for MATLAB desktop tools. On the Home tab, in the Environment section, click Preferences. Select MATLAB > Keyboard

> Shortcuts. If you have an active Internet connection, you can watch the Customizable Keyboard Shortcuts video for an overview.

The following sections provide details:

• “Steps for Customizing Keyboard Shortcuts” on page 2-22

• “Filter Keyboard Shortcut Actions” on page 2-25

• “Specify Keystrokes for a Keyboard Shortcut” on page 2-26

• “Evaluate and Resolve Keyboard Shortcut Conflicts” on page 2-27

• “Examples of Creating, Modifying, and Deleting Keyboard Shortcuts” on page 2-29

• “Display Keyboard Shortcuts” on page 2-19 Steps for Customizing Keyboard Shortcuts

1 On the Home tab, in the Environment section, click Preferences. Select MATLAB > Keyboard > Shortcuts.

2 In the Active settings field, choose the file that contains the set of keyboard shortcuts that you want to customize.

Define Keyboard Shortcuts

3 Under Action name, select the action for which you want to define or modify a keyboard shortcut. An action is the operation for which you want to customize the shortcut, such as Clear Command History.

For tips on finding the action you want, see “Filter Keyboard Shortcut Actions” on page 2-25.

4 Click the Add button .

An editable field opens under the Shortcut column.

5 Type the shortcut that you want to use for the action you selected in Step 3.

Alternatively, you can choose a shortcut from the drop-down menu.

For details, see “Specify Keystrokes for a Keyboard Shortcut” on page 2-26.

6 Assign the shortcut to the tool or tools with which you want to use it. For example, in the Tools with shortcut column:

a Click the down arrow for the list of desktop tools to which you can assign a shortcut. Not all actions are available with all desktop tools.

b Select a check box to assign the shortcut to a tool. Clear a check box to remove it.

7 Evaluate and resolve any conflicts, indicated by the informational and error icons.

For more information, see “Evaluate and Resolve Keyboard Shortcut Conflicts” on page 2-27.

8 Click Apply.

• The keyboard shortcut becomes available immediately.

• If a changed shortcut corresponds to a menu option that previously displayed no keyboard shortcut, MATLAB reflects the new keyboard shortcut on the menu.

Restore Default Keyboard Shortcut Sets

If you modify keyboard shortcuts, and then decide you do not want to keep the changes, you can restore the default shortcuts. To restore the default state of a keyboard shortcut:

1 Click the Actions button .

2 Select Undo Modifications to Windows Default Set (modified) or Undo Modifications to Emacs Default Set (modified), as appropriate for your system.

3 Click OK.

Note: Undoing modifications reverts all keyboard shortcuts changes that you made to the set. You cannot undo modifications on a shortcut-by-shortcut basis.

Save Keyboard Shortcuts to a Settings File Save keyboard shortcuts to a settings file to:

• Save changes you make to a default settings file, such as the Windows default set, to a new set.

MATLAB preserves changes you make to the default sets across sessions. However, if you undo modifications to a default keyboard shortcut set (as described in “Restore Default Keyboard Shortcut Sets” on page 2-24) you lose all changes, unless you first save them to a new set.

• Copy the keyboard shortcuts settings file to another system running MATLAB and use it there.

• Overwrite a settings file that you previously saved.

Define Keyboard Shortcuts

For example, you can submit your file to the File Exchange repository. Click this link to go directly to the page where you can submit your file: MATLAB Central File Exchange — Submit New File.

To save a keyboard shortcuts settings file, follow these steps:

1 Open the Keyboard Shortcuts Preferences dialog box. On the Home tab, in the Environment section, click Preferences. Select MATLAB > Keyboard >

Shortcuts.

2 Click the Actions button , and then select Save As.

3 In the Save dialog box, navigate to the folder where you want to save the file, specify the file name, and then click Save.

MATLAB saves the file as an .xml file in the folder that you specified.

Filter Keyboard Shortcut Actions

Use the filter field to see the list of actions for which you can customize or define a keyboard shortcut:

1 Type all or part of any one of the following:

• An action name, for example, Delete.

MATLAB displays only the action names or desktop menus that contain the text you specify.

• The name of a desktop tool or menu, for example, File or Command Window.

MATLAB displays a list of the action names associated with the tool or menu you specify. In addition, the list includes any action names that contain the name of the tool or menu. For example, if you specify Command History, the list of action names includes Next History Command, which is a Command Window action.

• A keyboard shortcut, for example, Ctrl+R

MATLAB displays only the action names that have the shortcut you specify. Be aware of the following:

• You can enter most keyboard shortcuts by either pressing keystrokes or typing the key names.

For example, to enter Ctrl+S, use the keystroke (by pressing the Ctrl key and the S key). Or, type Ctrl+S character by character (C-t-r-l-+-Y).

• If using keystrokes for a keyboard shortcut does not work, try typing the characters instead. You must type some keyboard shortcuts character by character, such as shortcuts including the Tab, Backspace, or Delete keys.

• Type numpad to refer to the number pad that is on the far right of some keyboards.

• Type Up or Down to refer to the Up arrow or Down arrow keypad keys, respectively.

2 Verify that an Action name performs the action you expect:

a Hover the mouse pointer over the Action name. For example, Remove Next Word.

b View the tooltip that appears.

Specify Keystrokes for a Keyboard Shortcut

A keystroke can be a single key or the combination of a modifier (Alt, Shift, or Ctrl) and another key. When you create a keyboard shortcut, specify the keystrokes for the shortcut as follows:

1 Click the Add button .

Define Keyboard Shortcuts

a Click the down arrow next to the key icon in the Shortcuts field.

b Choose Limit to 1 keystroke, Limit to 2 keystrokes, or Limit to 3 keystrokes.

For instance, Ctrl+F is one keystroke, Ctrl+Y, Shift+Z is two keystrokes, and Ctrl+Y, Shift+Z, F9 is three keystrokes.

3 Specify the keystrokes by doing one of the following:

• Type the keystrokes, by pressing the keys, not by typing the key names character by character.

For example, press the Ctrl key and the Y key. Do not type C-t-r-l-+-Y.

• Choose a keystroke, such as the Tab key, by clicking the down arrow next to the key icon in the Shortcuts field. Then, choose the key name.

The listed keys already have a defined action within dialog boxes. For example, the Tab key navigates from one field to the next in dialog boxes.

Related documents