How Can I Override Visual Studio's Menu Accelerator Shortcuts?

99封情书 提交于 2019-12-02 21:05:19

Here's how to change the shortcut key for a Visual Studio menu, using the 'Test' menu as an example:

  1. Go to Tools, Customize.
  2. Click the Commands tab.
  3. Ensure the Menu bar option is selected, and that Menu Bar is chosen for editing from the drop-down (this is the primary application menu bar).
  4. In the Controls section, click on the Test menu.
  5. Click on the Modify Selection ▼ button.
  6. Change the text for the Name property:
    • Any letter prefixed with an '&' ampersand will act as the shortcut key.
    • The ampersand is not required if you don't need to reach this menu with the keyboard.
  7. Press Enter to keep the setting.

'Modify Selection' for the Test menu

Isn't this something the fault of the Windows API, not Visual Studio? I think the Alt (and nothing else) keyboard shortcuts are directed through Windows API, so the OS will probably not let you do this; it'll select the menu with the respective mnemonic (underlined letter).

You could try using a custom keyboard layout that would swap the left ctrl and left alt keys, allowing you to use "ctrl-S" but it feels like command-S.

Good Luck!

go to tools -options - keyboard(you may have to choose show all option or something like that to be able to see this one) and you can change the shortcuts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!