列出当前键盘快捷键映射
1.在“工具”菜单上指向“宏”,再单击“宏 IDE”。
2.在“项目资源管理器”中双击“MyMacros”。
3.右击“Module1”,再单击“重命名”。
4.键入 KeyboardShortcuts 作为模块的新名称。
5.双击“KeyboardShortcuts”可在编辑器中打开该文件。
8.切换回 Visual Studio。
9.在“工具”菜单上指向“宏”,再单击“Macro 资源管理器”。
10.展开“MyMacros”,再展开“KeyboardShortcuts”。
11.右击“GetAllCommands”,再单击“运行”。
该宏生成一个列表,列出 IDE 中所有可能的命令以及这些命令在当前键盘映射方案下所具有的所有键盘快捷键映射。
12.在“视图”菜单上,单击“输出”。
命令及其快捷组合键将显示在“输出”窗口中。 您可以复制此信息,并将其粘贴到另一个应用程序(如 Microsoft Office Excel)中,用于其他格式设置和打印选项。
1.在“工具”菜单上指向“宏”,再单击“宏 IDE”。
2.在“项目资源管理器”中双击“MyMacros”。
3.右击“Module1”,再单击“重命名”。
4.键入 KeyboardShortcuts 作为模块的新名称。
5.双击“KeyboardShortcuts”可在编辑器中打开该文件。
6.将下面的代码粘贴到文件中 Public Module KeyboardShortcuts 之后:
Sub GetAllCommands()
Dim cmd As Command
Dim ow As OutputWindow = DTE.Windows.Item(Constants.vsWindowKindOutput).Object
Dim owp As OutputWindowPane
Dim exists As Boolean
Dim i As Integer
Dim sArray() As String
sArray = New String() {}
i = 1
exists = False
For Each owp In ow.OutputWindowPanes
If owp.Name = "Macro Output" Then
exists = True
Exit For
End If
i = i + 1
Next
If exists Then
owp = ow.OutputWindowPanes.Item(i)
Else
owp = ow.OutputWindowPanes.Add("Macro Output")
End If
owp.Clear()
' Output 1 line per command
For Each cmd In DTE.Commands
Dim binding As Object
Dim shortcuts As String
shortcuts = ""
For Each binding In cmd.Bindings
Dim b As String
b = binding
If Not shortcuts = "" Then
shortcuts += "--OR-- "
End If
shortcuts = shortcuts + b + " "
Next
shortcuts = shortcuts.Trim()
If Not cmd.Name.Trim().Equals("") And Not shortcuts.Equals("") Then
sArray.Resize(sArray, sArray.Length + 1)
sArray(sArray.Length - 1) = cmd.Name + vbTab + shortcuts
End If
Next
Array.Sort(sArray)
owp.OutputString(String.Join(vbCrLf, sArray))
End Sub
7.在“文件”菜单上,单击“保存 MyMacros”。
8.切换回 Visual Studio。
9.在“工具”菜单上指向“宏”,再单击“Macro 资源管理器”。
10.展开“MyMacros”,再展开“KeyboardShortcuts”。
11.右击“GetAllCommands”,再单击“运行”。
该宏生成一个列表,列出 IDE 中所有可能的命令以及这些命令在当前键盘映射方案下所具有的所有键盘快捷键映射。
12.在“视图”菜单上,单击“输出”。
命令及其快捷组合键将显示在“输出”窗口中。 您可以复制此信息,并将其粘贴到另一个应用程序(如 Microsoft Office Excel)中,用于其他格式设置和打印选项。